Date: Wed, 28 Apr 2004 14:39:48 -0700 From: "Foster, ThomasX" <thomasx.foster@intel.com> To: <freebsd-questions@freebsd.org> Subject: OpenLDAP & backSQL Message-ID: <C96CF509350DEC44895435C5BC929B840EC0DD@orsmsx405.jf.intel.com>
next in thread | raw e-mail | index | archive | help
I hope this is the right list to post this question, so please correct me if not =20 I have read quite a bit of documentation on setting up OpenLDAP with back-SQL, using libiODBC and MyODBC to connect to MySQL. In an attempt to get this running myself, I started by compiling these ports in this order: =20 mysql-server-4.0.18_1 --> mysql-client-4.0.18_1 =20 openldap-server-2.1.30 (--enable-sql=3DYES) --> openldap-client-2.1.30 =20 libiodbc-3.51.1_4 =20 myodbc-3.51.06 =20 I created a MySQL database called "ldap", and granted all privileges on it to a user called "ldap" with a password. I then imported the SQL schema from the OpenLDAP rdbms_depend directory into the MySQL database successfully. I can connect to the database as the "ldap" user and successfully view and augment the "ldap" database. =20 I then proceeded to configure my "slapd.conf" with the following information: =20 ############################## SLAPD.CONF ############################################### =20 # $OpenLDAP: pkg/ldap/servers/slapd/back-sql/rdbms_depend/mysql/slapd.conf,v 1.3 2001/08/02 15:28:59 mit Exp $ # # See slapd.conf(5) for details on configuration options. # This file should NOT be world readable. # include /usr/local/etc/openldap/schema/core.schema include /usr/local/etc/openldap/schema/cosine.schema include /usr/local/etc/openldap/schema/inetorgperson.schema =20 # Define global ACLs to disable default read access. =20 # Do not enable referrals until AFTER you have a working directory # service AND an understanding of referrals. #referral ldap://root.openldap.org =20 pidfile /usr/local/var/slapd.pid argsfile /usr/local/var/slapd.args loglevel 32 ####################################################################### # sql database definitions ####################################################################### =20 database sql suffix "o=3Dsql,c=3DRU" rootdn "cn=3Droot,o=3Dsql,c=3DRU" rootpw secret dbname ldap dbuser ldap dbpasswd password =20 oc_query "SELECT id,name,keytbl,keycol,create_proc,delete_proc,expect_ret urn FROM ldap_oc_mappings" at_query "SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc, param_order,expect_return FROM ldap_attr_mappings WHERE oc_map_id=3D?" subtree_cond "ldap_entries.dn LIKE CONCAT('%',?)" insentry_query "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) VALUES (? ,?,?,?)" delentry_query "DELETE FROM ldap_entries WHERE id=3D?" strcast_func "text" concat_pattern "?||?" =20 I configured "/usr/local/etc/libiodbc/odbc.ini" with the following information: =20 ######################### ODBC.INI ############################################## =20 [ODBC Data Sources] ldap =3D MySQL LDAP DSN =20 [ldap] Driver =3D /usr/local/lib/libmyodbc3.so Description =3D OpenLDAP Database Host =3D localhost ServerType =3D MySQL Port =3D 3306 FetchBufferSize =3D 99 UserName =3D ldap Password =3D password Database =3D ldap ReadOnly =3D no Socket =3D /var/lib/mysql/mysql.sock =20 [ODBC] InstallDir=3D/usr/local/lib =20 When I go to manually start "slapd", I get the following output: =20 slapd startup: initiated. =3D=3D>backsql_db_open(): testing RDBMS connection backsql_db_open(): setting 'ldap_entries.dn=3D?' as default =3D=3D>backsql_get_db_conn() =3D=3D>backsql_open_db_conn() backsql_open_db_conn: SQLConnect() to database 'ldap' as user 'ldap' failed: Return code: -1 Native error code: 2005 SQL engine state: S1000 Message: [MySQL][ODBC 3.51 Driver]Unknown MySQL Server Host '' (1) backsql_get_db_conn(): could not get connection handle -- returning NULL backsql_db_open(): connection failed, exiting backend_startup: bi_db_open(0) failed! (1) slapd shutdown: initiated =3D=3D>backsql_db_close() <=3D=3Dbacksql_db_close() slapd shutdown: freeing system resources. =3D=3D>backsql_db_destroy() =3D=3D>backsql_free_db_env() <=3D=3Dbacksql_free_db_env() =3D=3D>destroy_schema_map() <=3D=3Ddestroy_schema_map() <=3D=3Dbacksql_db_destroy() slapd stopped. =20 I have tried running iodbctest and checking the DSN=3Dldap, and I get = the following error: =20 iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.51.0001.0908 =20 Enter ODBC connect string (? shows list): DSN=3Dldap [MySQL][ODBC 3.51 Driver]Unknown MySQL Server Host '( =20 The test then stops.. and I must Ctrl+C to quit out of it. This leads me to believe I have configured the ODBC incorrectly. I had moved the odbc.ini file to /usr/local/etc/ and have even tried exporting the ODBCINI variable pointing to the path of odbc.ini, but this has not seemed to help the situation. I get the following from iodbctest: =20 iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.51.0001.0908 =20 Enter ODBC connect string (? shows list): ? =20 DSN | Description --------------------------------------------------------------- ldap | MySQL LDAP DSN =20 Enter ODBC connect string (? shows list): DSN=3Dldap [MySQL][ODBC 3.51 Driver]Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), SQLSTATE=3DHY000 =20 When I remove the socket statement from the "odbc.ini" I get the following error: =20 iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.51.0001.0908 =20 Enter ODBC connect string (? shows list): DSN=3Dldap [MySQL][ODBC 3.51 Driver]Access denied for user: 'dummy@localhost' (Using password: YES), SQLSTATE=3DHY000 =20 I feel this is an obvious configuration issue, but I cannot seem to find anymore information on the subject. Any suggestions? Any input is appreciated. Thanks =20 Thomas Foster http://www.section6.net <http://www.section6.net/>=20 =20 =20 "In a world without fences or walls, there is no need for Gates or Windows." =20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C96CF509350DEC44895435C5BC929B840EC0DD>