If we can add "account required pam_permit.so" in /etc/pam.d/mysqld then it will work otherwise it will not allow to login with linux password.
Without pam_permit.so,
[root@localhost ~]# mysql -u ap_user -p
Enter password:
ERROR 1045 (28000): Access denied for user 'ap_user'@'localhost' (using password: YES)
With pam_permit.so in /etc/pam.d/mysqld
[root@localhost ~]# mysql -u ap_user -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.36-34.2 Percona Server (GPL), Release rel34.2, Revision 648
Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Confirmed with CentOS 5.9.
If we can add "account required pam_permit.so" in /etc/pam.d/mysqld then it will work otherwise it will not allow to login with linux password.
Without pam_permit.so,
[root@localhost ~]# mysql -u ap_user -p @'localhost' (using password: YES)
Enter password:
ERROR 1045 (28000): Access denied for user 'ap_user'
With pam_permit.so in /etc/pam.d/mysqld
[root@localhost ~]# mysql -u ap_user -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.36-34.2 Percona Server (GPL), Release rel34.2, Revision 648
Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>