I'm trying to make MariaDB, PAM, and Centrify work together on Ubuntu 12.04, and so far I haven't had any luck. Centrify is working, and I am using it successfully for SSH and sudo.

My goal is to use Active Directory for MySQL\MariaDB authentication. I noticed that the MySQL PAM modules are commercial, and since I'd like to avoid spending cash on software, MariaDB seems like the logical choice. Having installed the LAMP option when building the system, I removed MySQL, installed MariaDB, and enabled the PAM module for it. I followed the instructions at https://kb.askmonty.org/en/pam-authentication-plugin/ to get where I'm currently at.

The user account was created with:

CREATE USER myuser IDENTIFIED VIA pam USING 'mariadb_mtr';
The contents of /etc/pam.d/mariadb_mtr is:

auth            required        pam_mariadb_mtr.so pam_test
account         required        pam_mariadb_mtr.so
When logging in with mysql -u myuser -p, I get the following in syslog:

Dec  4 08:32:23 precise-test mysqld: 121204  8:32:23 [Warning] Access denied for user 'myuser'@'localhost' (using password: YES)
Note that "myuser" is (should be) a domain account, which I assume doesn't need to be in the myuser@domain.org format. I don't need to use this format when logging in via SSH, so I assume it's same/same for MariaDB.

What am I doing wrong? If it's not obvious, how do I go about debugging/troubleshooting?