• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue ERROR: PleskDBException: Unable to connect to database: mysql_connect():

Ikram

New Pleskian
i am using plesk 12.0.18 with centos 7, when i try to login plesk this error appeared

ERROR: PleskDBException: Unable to connect to database: mysql_connect(): Access denied for user 'admin'@'localhost' (using password: YES) (Error code: 1045) (Abstract.php:69)

using this help i was able to access plesk https://talk.plesk.com/threads/i-can-not-access-the-plesk-panel-12-5.336203/

everything is working fine only i unable access mysql database this error at Local MySql Server

Error: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement

if i remove skip-grant-tables from /etc/my.cnf again same error occured and unable to access plesk this is production server. and i am very worried about it Thanks

my.cnf and ps aux | grep mysql;
please also check http://i66.tinypic.com/2gwg5rp.jpg
 
The password in /etc/psa/.psa.shadow does not match the admin@localhost password. This is not the Plesk administrator password that you use to sign on to the Plesk panel, but the database root password that Plesk needs to be able to connect to the database.

Verify that you know your current admin@localhost password by logging on to Plesk manually:
# mysql -u admin -p

If you cannot login using the password that you think is correct, reset Plesk database password to a new value:
- Start MySQL (or MariaDB) with --skip-grant-tables
- Login without password
- Update password field
# UPDATE mysql.user SET Password = password('newpassword') WHERE User = 'admin';
with newpassword = the new password of your choice.
This is not the Plesk GUI "admin" password, but the password that is used to log in to the database on the database server.
- Logout of DB
- Restart MySQL/MariaDB regularly (without the --skip-grant-tables option)

And now, most important:
Store the new database password for MySQL admin@localhost into this file: /etc/psa/.psa.shadow
 
The password in /etc/psa/.psa.shadow does not match the admin@localhost password. This is not the Plesk administrator password that you use to sign on to the Plesk panel, but the database root password that Plesk needs to be able to connect to the database.

Verify that you know your current admin@localhost password by logging on to Plesk manually:
# mysql -u admin -p

If you cannot login using the password that you think is correct, reset Plesk database password to a new value:
- Start MySQL (or MariaDB) with --skip-grant-tables
- Login without password
- Update password field
# UPDATE mysql.user SET Password = password('newpassword') WHERE User = 'admin';
with newpassword = the new password of your choice.
This is not the Plesk GUI "admin" password, but the password that is used to log in to the database on the database server.
- Logout of DB
- Restart MySQL/MariaDB regularly (without the --skip-grant-tables option)

And now, most important:
Store the new database password for MySQL admin@localhost into this file: /etc/psa/.psa.shadow

thanks Peter.. yes i am able to login using # mysql -u admin -p .. my current password
this is because i am using skip-grant-tables... even without password i am able to login in to mysql
 
/etc/psa/.psa.shadow is a text file with only a single line of text. This line is the password that is used by Plesk to login to the database using admin@localhost. You must edit the file and put your valid admin@localhost password into that file to enable Plesk to access the psa database.
 
Not, it looks like an encrypted string, but is actually not encrypted. Glad that you found the other thread. Maybe that can help.
 
Not, it looks like an encrypted string, but is actually not encrypted. Glad that you found the other thread. Maybe that can help.
Thanks alot Peter really apreciate your help, one thing should i remove encrypted password and use the normal password..
 
this command show me password
cat /etc/psa/.psa.shadow

but this give me a error
/usr/local/psa/bin/admin --show-password
Unable to connect to database: (Error code: 1045)
 
Yes i successfully login with this password $AES-128-..........==

/usr/local/psa/bin/admin --show-password
shows

different password... like normal which i use to login in plesk
 
/usr/local/psa/bin/admin --show-password
shows

different password... like normal which i use to login in plesk
 
i go through these articles several times.. and done with these instructions. but i remove --skip-grant-tables same error appear and unable to access plesk.. dont know.. is there any privileges issue apart from that
 
Yes i successfully login with this password $AES-128-..........==

/usr/local/psa/bin/admin --show-password
shows

different password... like normal which i use to login in plesk

It seems that you are still mixing up the two different "admin" accounts. The /usr/local/psa/bin/admin --show-password has nothing to do with the SQL "admin@localhost" error you have initially posted. You are now again referring to the Plesk GUI administrator password. This is NOT the problem. The problem you have posted was, that Plesk cannot login to the database using admin@localhost and the password given in /etc/psa/.psa.shadow.

First take care of the issue that Plesk cannot login to the database. All information you need for that has already been presented in this thread. If you say you can login using the password that is stored in /etc/psa/.psa.shadow and if you have also not set old-passwords=1, then Plesk should be able to connect and login to the database server. Can Plesk login to the database now?
 
Back
Top