Plesk ERROR: PleskFatalException Unable to connect to database: saved admin password is incorrect. 0: common_func.php

Sometimes we may face the error while trying to access the Plesk control panel:

ERROR: PleskFatalException 
Unable to connect to database: saved admin password is incorrect.
0: /usr/local/psa/admin/plib/common_func.php3:190
psaerror(string 'Unable to connect to database: saved admin password is incorrect.')
1: /usr/local/psa/admin/auto_prepend/auth.php3:93

Usually this error comes because because the password in the file /etc/psa/.psa.shadow used to access the Plesk Panel database does not match your admin password.

You can follow these steps to reset the password and issue will be resolved.

Step-1. Modify the MySQL server settings in the file /etc/my.cnf and add the skip-grant-tables option in the [mysqld] section:

[mysqld]
skip-grant-tables

Step-2.Restart the MySQL server:

/etc/init.d/mysqld restart

Step-3.Add new password to the 

/etc/psa/.psa.shadow file.

Step-4.Repair password with the command line below:

# /usr/bin/mysql -D mysql -e"update user set password=PASSWORD('`cat /etc/psa/.psa.shadow`') where User='admin';"

Step-5.Remove skip-grant-tables option from /etc/my.cnf

Step-6.Restart the MYSQL server:

/etc/init.d/mysqld restart

Done. Try to access the panel now.