• 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.

Resolved Changing root/MySQL passwords

ulitre

New Pleskian
Thank you for your assistance!

Using Plesk 12.5.30 on CentOS 6.8
  • Does changing the root password in the Plesk control panel change the MySQL as well?
  • What is the recommended approach to changing both the Plesk control panel root password as well as the local MySQL password?
  • In Tools Settings > Database Servers > localhost, only the “admin” username is present but I find no way to set a new password for the admin account where can this password be set?
 
Changing the administrator password in Plesk panel does not change the admin@localhost database password.

In order to update the admin@localhost DB user password to NEWPASSWORD:
1) Login to database
# plesk db
2) Run this SQL command:
UPDATE user SET password=PASSWORD('NEWPASSWORD') where user LIKE 'admin';
3) Replace the password listed in /etc/psa/.psa.shadow with NEWPASSWORD. Do not encrypt the new password, just replace the existing line with the new password.
Details: https://support.plesk.com/hc/en-us/articles/213364309

In order to update the administrator password of Plesk panel:
# /usr/local/psa/bin/init_conf -u -passwd NEWPASSWORD
Details: https://support.plesk.com/hc/en-us/...-or-reset-password-for-admin-account-in-Plesk
 
Last edited:
I use the commands you recommend and change the admin password; it succeeds. But still cannot login using the new password.

Code:
UPDATE user SET password=PASSWORD('NEWPASSWORD') where user LIKE 'admin';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Then I exit and want to log in using the new password like;
Code:
mysql -uadmin -pNEWPASSWORD

It says access denied.
 
# mysql -u admin -p
Then enter or paste the password into the prompt. Directly adding the password behind the -p does not work when the password contains specific characters.
 
I also tried that; it didn't work. After 5 minutes or so; now retrying, this time I can login to MySQL using mysql -uadmin -ppassword; but can't login to Plesk, because psa.shadow is not synced. It says access denied in Plesk login page.

How can I sync the .psa.shadow so it can use the same password I just set using that SQL command?

Edit: Unable to access Plesk: Access denied for user 'admin'@'localhost' (using password: YES)

This article here recommends to update MySQL rather updating .psa.shadow. This would revert the password change back; which is not actually the desired result.

Ultimately I need to update .psa.shadow with the new password's encryption.
 
That command updates the Plesk's password. So what I conclude from this is; MySQL admin password must always be the same with the Plesk admin password. Is that right?

Edit: --set-password switch gives an access denied error. So it doesn't work.
 
No. The Plesk graphical user interface admin password is different from the Plesk database admin password. They can be the same, but normally they ought to be different. It is only a coincidence that both user names are "admin".
 
The .psa.shadow content is NOT your Plesk GUI admin password. If you have followed the guide from above where I described how to set the admin password according to the .psa.shadow password, there is no need to sync it again. You are mixing things up. There is a difference between the technical background database admin password and the Plesk admin user password that you use to login to Plesk.
 
No, I think something is not clear here. I followed that guide and it restores the password to what Plesk knows. That means, my changing password of the MySQL admin is reverted; so it's the old password now.

This way I can get into Plesk OK; but I can't login to MySQL from shell. (Access denied). I can point the shadow file and it lets me login this way; but I can never change the password; because the syncronization between it and the shadow file would break.

To sum up; what is the proper way to change the MySQL admin password without breaking Plesk?

Edit: Please let me remind you that I already followed your steps in pos #2. It makes me login to MySQL from shell possible; but breaks Plesk.
 
Last edited:
You have to then run in mysql:
FLUSH PRIVILEGES;

Now it works for me.

Would be great for Plesk to update this post with ALL the commands needed.
 
Hi there, I followed these instructions and now I can't log in to plesk, but I can login into mysql via ssh as admin with the new password?

How do I fix the access to plesk though?

Added note: I ca access Plesk using root but not admin
 
Last edited:
To log in to the command line you either use:
# mysql -u admin -p`cat /etc/psa/.psa.shadow`
(note: these are backticks and there is no space after -p)
or
# plesk db
(note: this will take you directly to the database 'psa')
 
  • Like
Reactions: Dru
Back
Top