2015年1月21日 星期三

OpenLDAP for windows(連接mysql)

openldap 版本:openldap-2.4.38-x86

下載網址http://sourceforge.net/projects/openldapwindows/

安裝步驟 一直下一步就好(安裝路徑我是設在C:\OpenLDAP)

安裝完後打開 C:\OpenLDAP\etc\openldap\slapd.conf

找到BDB database definitions部分
可以修改下面3行(我是用默認的,做測試用的而已)         
suffix "dc=my-domain,dc=com"
rootdn "cn=Manager,dc=my-domain,dc=com"
rootpw test


過來就是連接mysql部分
找到# MySQL Database  修改資料庫資料
backend              sql
database             sql
suffix               "dc=example,dc=com"
rootdn               "cn=root,dc=example,dc=com"
rootpw               test
dbname               openldap    #資料庫表名稱
dbuser               root         #資料庫帳號
dbpasswd           ******     #資料庫密碼
insentry_stmt       "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) VALUES (?,?,?,?)"
subtree_cond         "ldap_entries.dn LIKE CONCAT('%',?)"
upper_func           "upper"
concat_pattern       "?+?"
has_ldapinfo_dn_ru   no
check_schema         yes
database        monitor


修改完到C:\OpenLDAP\etc 打開odbc.ini

找到MySQLTestServer 改成

[openldap]  #資料庫表名稱
Driver=MySQL
Description=Test MySQL Database 2013
Server=localhost
Port=3306
Database=openldap #資料庫表名稱
# UID=openldap
Password=*****  #資料庫密碼


改完後到C:\OpenLDAP\etc\back-sql\mysql  

把01_backsql_create.sql,
   02_testdb_create.sql
   03_testdb_data.sql
   04_testdb_metadata.sql
都匯到資料庫


設定完後到C:\OpenLDAP\libexec  按StartLDAP.cmd  啟動

啟動完就可以連了

沒有留言:

張貼留言