[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: OpenLDAP with MySQL backend not working



Hi,

I have solved the problem.
It was an ODBC and slapd.conf misconfiguration.

You need to add the ODBC connection alias into slapd.conf  dbname   field

In my case it was [MySQL] in /etc/odbc.ini  and I added     dbname = MySQL
in /etc/openldap/slapd.conf    and now it works, I just need to tweak the
ACLs and the database structure to use it for authentication.

Thank you for the support and I hope that also my post will help others in
need.

Sincerely, Victor LAZA

-----Original Message-----
From: masarati@aero.polimi.it [mailto:masarati@aero.polimi.it] 
Sent: Sunday, September 25, 2011 9:55 PM
To: Victor LAZA
Cc: openldap-technical@openldap.org
Subject: RE: OpenLDAP with MySQL backend not working

> I have added the line you suggested and now I have "No database selected"
> mysql error
> I have run "isql -v MySQL ldap ldap" and it works...
>
> [root@server ~]# isql -v MySQL ldap ldap
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
>
> Somehow the dbname parameter is not transmited..
>
> ---
> ### the slapd -d -1 output
> ---
>
> <<< dnPrettyNormal: <dc=example,dc=com>, <dc=example,dc=com>
> <==backsql_dn2id("dc=example,dc=com"): err=0
> ==>backsql_id2entry()
> backsql_id2entry(): retrieving all attributes
> ==>backsql_get_attr_vals(): oc="organization" attr="o" keyval=1
> backsql_get_attr_vals(): error executing attribute count query 'SELECT
> COUNT(*) FROM institutes WHERE institutes.id=?'
> Return code: -1
>    nativeErrCode=1046 SQLengineState=3D000 msg="[unixODBC][MySQL][ODBC
> 3.51
> Driver][mysqld-5.0.77-log]No database selected"

To me this looks like either a RDBMS or an ODBC internal error.

p.

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1809 / Virus Database: 2085/4518 - Release Date: 09/25/11