• 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 code: 1045 - login to plesk

bruno911

New Pleskian
I have a VPS server with 1and1, using Plesk 12.50 on CentOs 7. Before I had Plesk in another server, at the time of the migration I had some trouble to get mysql working, but after search, some of the things I followed fixed that issue, so all websites were working ok, except the login to Plesk, whenever I try to login I get:

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

skip-grant-tables
on my.cnf​

It works, but of course I would prefer not to workaround it, and fix it properly.

Please note:

ls -la /etc/psa/.psa.shadow
-rw------- 1 psaadm psaadm 62 Oct 7 20:46 /etc/psa/.psa.shadow

mysql -uadmin -p`cat /etc/psa/.psa.shadow`
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)

mysql -uadmin -p
type current password works.

/usr/local/psa/bin/admin --show-password (when skip-grant-tables is enabled)
show me the correct password

cat /etc/psa/.psa.shadow
$AES-128-hash_intentionally_removed==

User accounts overview (from phpmyadmin)
User name Host name Password Global privileges User group Grant Action
Any % No USAGE No Export Export
ad localhost Yes USAGE No Export Export
admin localhost Yes ALL PRIVILEGES Yes Export Export
apsc localhost Yes USAGE No Export Export
horde localhost Yes USAGE No Export Export
pma_wyc5j9wk2IDj localhost Yes USAGE No Export Export
roundcube localhost Yes USAGE No Export Export

Tried also:
export PSA_PASSWORD=’currentpassword’ ; /usr/local/psa/admin/sbin/ch_admin_passwd; unset PSA_PASSWORD
 
Hi bruno911,

when you already used the option "skip-grant-tables", pls. consider to correct the password for the admin in your "mysql" - database with the commands:

mysql -uadmin -p
use mysql;
UPDATE mysql.user SET Password = password('newpassword') WHERE User = 'admin';
FLUSH PRIVILEGES;

... where "newpassword" should meet the encrypted password from "cat /etc/psa/.psa.shadow"

Afterwards, pls. remove the option "skip-grant-tables" by commenting it again ( with an "#" in front! ) at "/etc/mysql/my.cnf" ( or "etc/my.cnf" ) and restart mysql. Test your old/new password with the command:

mysql -uadmin -p`cat /etc/psa/.psa.shadow`
... and report possible errors/issues/problems.

Pls. make sure, that you don't have any additional "my.cnf" - files on your server ( i.e. at : "/root/.my.cnf" - delete the file, if it is existent! ).
 
Last edited by a moderator:
Hi,

Thank you for your assistance, and sorry for my late response. I tried it today, and followed all the suggested steps.

UPDATE mysql.user SET Password = password('unencryptednewpassword') WHERE User = 'admin';

But after I restart the service:
mysql -uadmin -p`cat /etc/psa/.psa.shadow`
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)

Please note that the command:

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

Shows me the encrypted password, so I also tried

UPDATE mysql.user SET Password = password('encryptednewpassword') WHERE User = 'admin';

mysql -uadmin -p`cat /etc/psa/.psa.shadow`
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)

But still the same, any other suggestion?

 
Hi bruno911,

first pls. be informed, that using
UPDATE mysql.user SET Password = password('unencryptednewpassword') WHERE User = 'admin';
is TOTALLY wrong. If you still want to try that again, for whatever reason, pls. note, that issues/problems/errors are more than normal and expected!


As mentioned before, your issue seems to depend on the fact, that you have a SECOND "my.cnf", with a global user+password set. Pls. use a find command, to locate it:

find / -type f -name "*.cnf" -exec grep --color -Hni "my" {} \;


If you experience the issue, that the command "/usr/local/psa/bin/admin --show-password" ( which is no longer supported on Plesk Onyx ) displays the ENCRYPTED password, pls. try to follow ( STEP-BY-STEP, pls.! ):



If, for what ever reason, you still experience issues, pls. report ALL steps from your command line and include as well your MySQL - log from "/var/log/mysql/error.log", so that people willing to help you have the chance to investigate possible misconfigurations.
 
Back
Top