Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)


share|improve this question
up vote 0 down vote accepted

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

driver = MySQL
Database = database_name
Server =
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/*

share|improve this answer
Thank you for the answer. In the config file can i reference one database containing the metadata mapping tables and one database containing my user data? Is OpenLDAP capable of retrieving data from multiple databases? – fga Feb 10 '12 at 12:58
As far I can remember, unfortunately it supports only a single datasource. – Giovanni Toraldo Feb 14 '12 at 7:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.