• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Suddenly can't get access to mysql via command line

SacAutos

Regular Pleskian
I'm rather perplexed. This morning I went to use mysql via the command line while logged in as root (CentOS 5.6 with Plesk 10.4.4 and all the updates):

[root@vserver ~]# mysql -uadmin -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
[root@server ~]#

and I was denied. I haven't changed any passwords in months. And I have the correct admin password. Admittedly I haven't tried using mysql at the command line in a while either. Any ideas what I can do to get this working again or what I can check?
 
Hi,

Don't use the admin password, use the contents of /etc/psa/.psa.shadow :

mysql -u admin -p$(cat /etc/psa/.psa.shadow)

In Plesk 10.something the /etc/psa/.psa.shadow became encrypted, but so as not to break script compatibility (all of our scripts that need it cat that file for db access) Parallels simply made the mysql admin password the encrypted version of the Plesk admin password. Clear as mud eh?

Paul
 
Perfect!

That was exactly what I needed. I'm back in business. Thank you for that useful tip!
 
Back
Top