The funny part here, my odbc test result -
====================================================== 1: SQLDriverConnect = [MySQL][ODBC 3.51 Driver]Could not determine the driver name; could not lookup setup library. DSN=(test) (0) SQLSTATE=HY000 1: ODBC_Connect = [MySQL][ODBC 3.51 Driver]Could not determine the driver name; could not lookup setup library. DSN=(test) (0) SQLSTATE=HY000 ======================================================
Where as LDAP is able to connect to MySQL. I am using "test" database from MySQL and DSN name is "test".
One more thing, why was slapd looking for /tmp/mysql.sock? I had specified Socket = /var/lib/mysql/mysql.sock
Here is my odbc.ini -
; begin odbc.ini [ODBC Data Sources] test = Connector/ODBC 3.51 Driver DSN
[test] Driver = /usr/lib/libmyodbc3.so Description = Connector/ODBC 3.51 Driver DSN Server = localhost DSN = test Port = 3306 Socket = /var/lib/mysql/mysql.sock User = root Password = mysql Database = test ServerType = MySQL Option = TraceFile = /var/log/mysql_test_trace.log Trace = 0
[Default] Driver = /usr/lib/libmyodbc3.so Description = Connector/ODBC 3.51 Driver DSN Server = localhost DSN = test Port = 3306 Socket = /var/lib/mysql/mysql.sock User = root Password = mysql Database = test ServerType = MySQL Option = TraceFile = /var/log/mysql_test_trace.log Trace = 0 ;end odbc.ini
On 5/23/07, Gabriel Stein gabrielstein@gmail.com wrote:
What´s your result for odbctest ou iodbctest? This command shows your ODBC connection?
And more: you set your slapd.conf with your ODBC Connection Name, not your MySQL dbname.
For example, if you have a database with name ldap and setup a ODBC connection with name test, you need set test on your slapd.conf
An ODBC Connection for example, in your /etc/odbc.ini
[ODBC Data Sources] test = MySQL ODBC 2.50 Driver DSN
[test] Driver = /usr/local/lib/libmyodbc.so Description = MySQL ODBC 2.50 Driver DSN DSN = test Server = localhost PORT = 3306 SOCKET = /var/lib/mysql/mysql.sock User = *valid_user* Password = *valid_passwd* Database = ldap ReadOnly = no ServerType = MySQL
FetchBufferSize = 99 ServerOptions = ConnectOptions = OPTION = 3 TraceFile = /var/log/mysql_test_trace.log Trace = 0
Cheers,
On 5/23/07, Ace rajan.halade@gmail.com wrote:
Hi Friends,
I am trying to configure LDAP with MySQL 5.0 as backend. I am using
Connector/ODBC 3.51 and LDAP 2.3.32 built from sources. While starting slapd I get following error -
=============================================== backsql_load_schema_map(): oc_query "SELECT id,name,keytbl,keycol,create_proc,delete_proc,expect_return FROM ldap_oc_mappings" backsql_load_schema_map(): error executing oc_query: Return code: -1 nativeErrCode=1046 SQLengineState=3D000 msg="[MySQL][ODBC 3.51Driver][ mysqld-5.0.27-standard]No database selected" ==>backsql_free_db_conn() ===============================================
My odbc.ini file has all the details and I can see in slapd log that its getting dbname before connective to MySQL server. slapd.conf has dbname = test.
Thanks in advance!
-- Cheers, Rajan
-- /\ Gabriel Stein gabrielstein@gmail.com MSN: gabrielstein@hotmail.com Administrador de Redes - Network Administrador Linux User #223750 51-92796310 Porto Alegre - RS - Brasil