Mysql – OpenLDAP MySQL Integration – Database Location for OpenLDAP back-sql metadata mapping tables

MySQLopenldap

I am trying to configure and OpenLDAP server on Ubuntu 10.04 to use a mysql database as its datasource. I am following the guides about the back-sql and realize that in order to map mysql schema with ldap schme i need to use the metadata mapping tables.

ldap_oc_mappings,
ldap_attr_mappings
ldap_entries,
ldap_entry_objclasses and
ldap_referrals

However most samples indicates database and ldap server being on the same location. Is it possible to create and use the mapping tables in a different database from the datasource i want to map with OpenLDAP? (in a different host database server e.g. in the LDAP server host)

Thanks

Best Answer

OpenLDAP rely on ODBC for connecting to the MySQL, you should configure in /etc/odbc.ini something like:

[database-reference]
driver = MySQL
Database = database_name
Server = 127.0.0.1
User = username
Password = mypassword

Change the Server attribute.

As a side note: since ODBC configuration may vary on different distributions, take always a look at the documentation shipped with your OpenLDAP and odbc package available in /usr/share/doc/*

Related Topic