The procedure for using the PAM authentication plugin as documented doesn't work flawlessly on
Ubuntu.
So here is how it works on Ubuntu (and probably also on other
Debian based systems).
Please note that the PAM authentication plugin is an enterprise
feature.
1. Make sure the plugin is loaded
This can be done by adding the following to the mysqld section of
my.cnf (Don't forget to restart). You could also use INSTALL
PLUGIN to load it without restart.
plugin-load=authentication_pam.so
2. Add a user which will use the plugin
mysql> CREATE USER 'dveeden'@'localhost' IDENTIFIED WITH authentication_pam;
Query OK, 0 rows affected (0.00 sec)
3. Add a pam config file for 'mysql':
Create /etc/pam.d/mysql with the following …