[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Openldap with MySQL: ODBC.INI not found !?
Hallo!
How can I configure Openldap with MySQL? Everytime no DSN is found. I think
that the odbc.ini is not found from the slapd.
I have:
- installed Openldap
- installed unixodbc
- export ODBCINI=/etc/odbc.ini
- change -liodbc to -lodbc
and this message come to me:
daemon_init: <null>
daemon_init: listen on ldap:///
daemon_init: 1 listeners to open...
ldap_url_parse_ext(ldap:///)
daemon: initialized ldap:///
daemon_init: 1 listeners opened
slapd init: initiated server.
==>backsql_initialize()
<==backsql_initialize()
==>backsql_db_init()
==>backsql_init_db_env()
<==backsql_init_db_env()
<==backsql_db_init()
==>backsql_db_config()
<==backsql_db_config(): dbname=dsn=mysql
==>backsql_db_config()
<==backsql_db_config(): dbuser=root
==>backsql_db_config()
<==backsql_db_config(): subtree_cond=upper(ldap_entries.dn) LIKE
CONCAT('%',?
==>backsql_db_config()
<==backsql_db_config(): insentry_query=INSERT INTO ldap_entries
(dn,oc_map_id,parent,keyval) VALUES (?,?,?,?)
slapd startup: initiated.
==>backsql_db_open(): testing RDBMS connection
backsql_db_open(): objectclass mapping SQL statement not specified (use
oc_query directive in slapd.conf)
backsql_db_open(): setting 'SELECT
id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM
ldap_oc_mappings' by default
backsql_db_open(): attribute mapping SQL statement not specified (use
at_query directive in slapd.conf)
backsql_db_open(): setting 'SELECT
name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expect_r
eturn FROM ldap_attr_mappings WHERE oc_map_id=?' by default
backsql_db_open(): entry deletion SQL statement not specified (use
delentry_query directive in slapd.conf)
backsql_db_open(): setting 'DELETE FROM ldap_entries WHERE id=?' by default
==>backsql_get_db_conn()
==>backsql_open_db_conn()
backsql_open_db_conn: SQLConnect() succeeded with info:
Return code: 1
Native error code: 0
SQL engine state: IM002
Message: [unixODBC][Driver Manager]Data source name not found, and no
default driver specified
backsql_open_db_conn(): connected, adding to tree
<==backsql_open_db_conn()
backsql_get_db_conn(): first call -- reading schema map
==>load_schema_map()
load_schema_map(): error preparing oc_query: 'SELECT
id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM
ldap_oc_mappings'
Return code: -1
Native error code: 0
SQL engine state: 08003
Message: [unixODBC][Driver Manager]Connnection does not exist
<==backsql_get_db_conn()
==>backsql_free_db_conn()
backsql_free_db_conn(): closing db connection
==>backsql_close_db_conn()
<==backsql_close_db_conn()
<==backsql_free_db_conn()
backsql_db_open(): test failed, schema map not loaded - exiting
backend_startup: bi_db_open 0 failed!
slapd shutdown: initiated
==>backsql_db_close()
<==backsql_db_close()
slapd shutdown: freeing system resources.
==>backsql_db_destroy()
==>backsql_free_db_env()
<==backsql_free_db_env()
==>destroy_schema_map()
<==destroy_schema_map()
<==backsql_db_destroy()
slapd stopped.
connections_destroy: nothing to destroy.
My /etc/odbc.ini:
============
[ODBC Data Sources]
mysql = mysql ODBC Driver
[mysql]
Driver = /usr/local/lib/libmyodbc.so
Database=ldap_mysql
dbname=mysql
Servername=localhost
PORT = 3306
UserName=root
Socket = /var/lib/mysql/mysql.sock
Trace = On
Tracefile = /tmp/offen.log
[ODBC]
Trace=ON
TraceFile=/tmp/odbctrace.out
InstallDir=/usr/local/lib
[Default]
Driver = /usr/local/lib/libmyodbc.so
My /usr/local/etc/openldap/slapd.conf
===========================
include /usr/local/etc/openldap/schema/core.schema
include /usr/local/etc/openldap/schema/cosine.schema
include /usr/local/etc/openldap/schema/inetorgperson.schema
# Define global ACLs to disable default read access.
#access to *
# by self write
# by dn=".+" write
# by * read
#defaultaccess none
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://localhost
pidfile /usr/local/var/slapd.pid
argsfile /usr/local/var/slapd.args
#schemacheck on
# the maximum number of entries to return from a search operation
#sizelimit 5000
# the maximum number of seconds slapd will spend answering a search request
#timelimit 120
#######################################################################
# sql database definitions
#######################################################################
database sql
suffix "o=sql,c=RU"
rootdn "cn=root,o=sql,c=RU"
rootpw secret
updatedn "cn=root,o=sql,c=RU"
dbname mysql
dbuser root
subtree_cond "upper(ldap_entries.dn) LIKE CONCAT('%',?"
insentry_query "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval)
VALUES (?,?,?,?)"
#upper_func "upper"
# Uncomment with a slave server
#updatedn "cn=root,o=sql,c=RU"
#updateref ldap://ldapmaster.samse.fr
Thank you very much
Stephan Niebrügge