Hi all,
Question for you. I've been racking my brains over this one for most the day without much success, and it seems my Google-Fu is no match for this one. I'm hoping you can help.
I'm attempting to setup OpenLDAP (2.4.13) with back-sql running as a module, relying on a MySQL server as a backend.
My problem appears to be due to the fact I'm trying to run the database server on a remote host, not the same box as OpenLDAP.
Attempting to start OpenLDAP gives the following error:
==>backsql_get_db_conn()
==>backsql_open_db_conn()
backsql_open_db_conn: SQLConnect() to database "ldap" as user "dc1auth1" failed:
Return code: -1
Native error code: 2002
SQL engine state: 08S01
Message: [MySQL][ODBC 3.51 Driver]Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
backsql_get_db_conn(): could not get connection handle -- returning NULL
backsql_db_open(): connection failed, exiting
However, obdc.ini (which has been separately tested) is configured to connect to the MySQL server on 192.168.1.34. My understanding is that the dbhost attribute in slapd.conf is ignored - we've set this anyway just to make sure.
Extracts from each:
Slapd.conf
database sql
suffix "dc=imagingthesouth,dc=com,dc=au"
rootdn "cn=Hostmaster,dc=imagingthesouth,dc=com,dc=au"
rootpw stat1c
dbname ldap
dbhost 192.168.1.36
dbuser dc1auth1
dbpass dc1auth1
subtree_cond "ldap_entries.dn LIKE CONCAT('%',?)"
insentry_query "INSERT INTO ldap_entries (dn,oc_map_id,parent,keval) VALUES (?,?,?,?)"
odbc.ini
[ldap]
Description = MySQL connection to Rhapsody
Driver = MySQL
DSN = ldap
Host = 192.168.1.34
Server = 192.168.1.34
Servername = 192.168.1.34
USER = dc1auth1
PASSWORD = passgoeshere
Database = rhapsody
Port = 3306
Option =
Stmt =
I'm slightly out of my depth here - any assistance would be greatly appreciated!
Many thanks,
Jason.
Jason B wrote:
However, obdc.ini (which has been separately tested) is configured to connect to the MySQL server on 192.168.1.34. My understanding is that the dbhost attribute in slapd.conf is ignored – we’ve set this anyway just to make sure.
In the man page of slapd-sql we can read:
dbhost <hostname> dbpasswd <password> dbuser <username>
The three above options are generally unneeded, because this information is taken from the datasource specified by the dbname directive. They allow to override datasource settings. Also, several RDBMS drivers tend to require explicit passing of user/password, even if those are given in datasource (Note: dbhost is currently ignored).
Bye A
That's what I was referring to in my original post - thanks for confirming :)
So just to be sure - there's no way to force back-sql to connect to a remote SQL server?
Thanks,
Jason.
----- Original Message ----- From: "alessio" alessio@ifc.cnr.it To: openldap-software@openldap.org Sent: Monday, 12 January, 2009 6:53:47 PM GMT +08:00 Perth Subject: Re: OpenLDAP connecting to remote MySQL server with back-sql
Jason B wrote:
However, obdc.ini (which has been separately tested) is configured to connect to the MySQL server on 192.168.1.34. My understanding is that the dbhost attribute in slapd.conf is ignored – we’ve set this anyway just to make sure.
In the man page of slapd-sql we can read:
dbhost <hostname> dbpasswd <password> dbuser <username>
The three above options are generally unneeded, because this information is taken from the datasource specified by the dbname directive. They allow to override datasource settings. Also, several RDBMS drivers tend to require explicit passing of user/password, even if those are given in datasource (Note: dbhost is currently ignored).
Bye A
-------------------------------Safe Stamp----------------------------------- Your Anti-virus Service scanned this email. It is safe from known viruses. For more information regarding this service, please contact your service provider.
Jason Backshall wrote:
That's what I was referring to in my original post - thanks for confirming :)
So just to be sure - there's no way to force back-sql to connect to a remote SQL server?
That should be entirely delegated to the ODBC layer, slapd shouldn't have anything to do with it. Otherwise, what would be the purpose of using ODBC in the first place? I have no time nor resources to look into this right now. If you can clearly indicate OpenLDAP's slapd is misusing ODBC in this sense, please file an ITS http://www.openldap.org/its, possibly with a patch that solves the issue.
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ----------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Fax: +39 0382 476497 Email: ando@sys-net.it -----------------------------------
openldap-software@openldap.org