Use LDAP for MySQL authentication?

Solution 1:

Enterprise MySQL (the version you pay Oracle to license) has a PAM module that allows for LDAP authentication:

MariaDB (a binary compatible version of MySQL developed by Monty) has an open source PAM module available for it:

I do not have hands on experience with either - I present them only as features I have heard of but not tested or used myself.

Solution 2:

You can use the auth_ldap plugin provided by Infoscope Hellas L.P. under GPL.

It can be downloaded from sourceforge here.


The plugin is still a Beta and works only for UNIX installations.

Solution 3:

A Mysql proxy can enable this for you using roles. More detail can be found here: and here:

Solution 4:

MySQL has a PAM authentication plugin that will let you use any available PAM module to provide authentication services. There is a pam_ldap module that is relatively easy to configure that should allow you to do what you want.

The plugin documentation includes an example using LDAP.

Solution 5:

I have published in my blog, an full example (with source code) of a LDAP Authentication plugin for MySQL.