使用 LDAP (AD) 进行 MySQL 身份验证

我正在尝试制定一个计划,允许用户使用 LDAP 对 MySQL 数据库(实际上是很多)进行身份验证.更具体地说,ActiveDirectory.数据库可能会通过应用程序而不是 Web 访问.我有哪些选择?

I'm trying to come up with a plan to allow users to auth with a MySQL database (many, actually) using LDAP. More specifically, ActiveDirectory. Database will likely be accessed through applications, not web. What are my options?

好的.似乎没有官方"方式允许使用 LDAP 在 MySQL 上进行身份验证.还有哪些其他选择?我们可以将 LDAP 用户和密码同步到 MySQL 用户表吗?

Okay. It seems that there is no "official" way to allow authentication on MySQL using LDAP. What other options exist? Can we synchronize LDAP users and passwords to the MySQL user table?

推荐答案

这可以通过 mysql 代理来实现.要完成这项工作,您需要了解以下几点:

this is possible with mysql proxy. there's a few things you need to know to make this work:

  • mysql代理可以执行shell命令
  • mysql代理可以拦截和重写认证

这两个页​​面将帮助您入门:

these two pages will help you get started:

  • 运行 shell 命令的示例:http://forge.mysql.com/tools/tool.php?id=79
  • 拦截和重写认证示例:http://web.archive.org/web/20150329071023/http://jan.kneschke.de/2009/6/25/mysql-proxy-roles/

相关文章