MySQL admin password is incorrect in Plesk

This article applies to 123-reg servers.

This article will explain what to do if the saved admin password is incorrect in your Plesk MySQL entry.

If you receive one of the following errors:

ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES) or:

ERROR: PleskFatalException
Unable to connect to database: saved admin password is incorrect.

0: common_func.php3:139
psaerror(string 'Unable to connect to database: saved admin password is incorrect.')
1: auth.php3:125
ERROR: PleskFatalException
Unable to connect to database: saved admin password is incorrect.

0: common_func.php3:139
psaerror(string 'Unable to connect to database: saved admin password is incorrect.')
1: auth.php3:125

ERROR: PleskFatalException
Unable to connect to database: saved admin password is incorrect.

0: common_func.php3:150
psaerror(string 'Unable to connect to database: saved admin password is incorrect.')
1: auth.php3:107
ERROR: PleskFatalException
Unable to connect to database: saved admin password is incorrect.

0: common_func.php3:150
psaerror(string 'Unable to connect to database: saved admin password is incorrect.')
1: auth.php3:107

ERROR 1049 (42000): Unknown database 'psa'
/etc/init.d/psa: line 269: /opt/psa/admin/sbin/websrvmng: No such file or directory

To fix this issue, check if there is a psa database. When going into MySQL or to Plesk do the following:

cat /etc/psa/.psa.shadow

Copy the password including == (This is the Encrypted_Password used later)

/etc/init.d/mysql stop (/etc/init.d/mysqld stop for CentOS)
ps aux | grep mysql | grep -v grep
kill

mysqld_safe --skip-grant-tables &
mysql -uadmin -p

Press enter

use mysql
select password from mysql.user where user="admin";

Copy password beginning with * just in case

update user set password=password('Encrypted_Password') where user="admin";
flush privileges;
quit
/etc/init.d/mysql stop (/etc/init.d/mysqld stop for CentOS)
kill

/etc/init.d/mysql start (/etc/init.d/mysqld start for CentOS)

Then refresh Plesk. If the server does not have the psa database or the fix does not work you will need to rebuild it.