pam_mysql is a module for pam to authenticate users with mysql
https://github.com/NigelCunningham/pam-MySQL