The procedure for using the PAM authentication plugin as documented doesn't work flawlessly on
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.