[Date Prev][Date Next] [Chronological] [Thread] [Top]

OpenLDAP with MySQL backend



Hi there,

Can anyone point me in the direction of some decent documentation on
using OpenLDAP with a MySQL backend (debian specific would be nice but I
can live with anything).

I have been looking through the documentation and other than saying you
use:

database	sql

it doesn't really go into any great detail. When I try and start slapd I
get the error:

	Unrecognized database type (sql)

I connot work out whether this is a configuration problem in my
slapd.conf or something to do with my ODBC driver. I have included my
configs below in case anyone has any ideas:

Thanks
Josh

slapd.conf
----------
# This is the main slapd configuration file. See slapd.conf(5) for more
# info on the configuration options.

#######################################################################
# Global Directives:

# Features to permit
allow bind_v2

# Schema and objectClass definitions
include         /etc/ldap/schema/core.schema
include         /etc/ldap/schema/cosine.schema
include         /etc/ldap/schema/nis.schema
include         /etc/ldap/schema/inetorgperson.schema

# Schema check allows for forcing entries to
# match schemas for their objectClasses's
schemacheck     on

# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile         /var/run/slapd/slapd.pid

# List of arguments that were passed to the server
argsfile        /var/run/slapd.args

# Read slapd.conf(5) for possible values
loglevel        0

# Where the dynamically loaded modules are stored
modulepath      /usr/lib/ldap
moduleload      back_sql

#######################################################################
# User Specific MySQL database

database        sql
suffix          "o=sql,c=RU"
rootdn          "cn=root,o=sql,c=RU"
rootpw          secret
dbname          ldap
dbuser          ldap
dbpasswd        password
subtree_cond    "ldap_entries.dn LIKE CONCAT('%',?)"
insentry_query  "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval)
VALUES (?,?,?,?)"

# The userPassword by default can be changed
# by the entry owning it if they are authenticated.
# Others should not be able to see it, except the
# admin entry below
# These access lines apply to database #1 only
access to attrs=userPassword
        by dn="cn=admin,dc=gktest,dc=plus,dc=net" write
        by anonymous    auth
        by self         write
        by *            none

# Allow users to change the other attributes
access  to *
        by dn="cn=admin,dc=gktest,dc=plus,dc=net" write
        by self         write
        by users        read
        by *            none

ldap.conf
---------

# $OpenLDAP: pkg/ldap/libraries/libldap/ldap.conf,v 1.9 2000/09/04
19:57:01 kurt Exp $
#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

BASE	dc=gktest, dc=plus, dc=net
URI	ldap://localhost


odbc.ini
---[ODBC Data Sources]
ldap_mysql = MySQL LDAP DSN

[ldap_mysql]
Driver          = /usr/lib/odbc/libmyodbc.so
Description     = OpenLDAP Database
Host            = localhost
ServerType      = MySQL
Port            = 3306
FetchBufferSize = 99
User            = ldap
Password        = password
Database        = ldaptest
ReadOnly        = no
Socket          = /var/run/mysqld/mysqld.sock

[ODBC]
InstallDir=/usr/lib/odbc


odbcinst.ini
------------
[ODBC Drivers]
MySQL 		= Installed

[MySQL]
Description	= MySQL driver
Driver		= /usr/lib/odbc/libmyodbc.so
Setup		= /usr/lib/odbc/libodbcmyS.so
CPTimeout	= 
CPReuse		= 
UsageCount	= 1