How can I change/repair my Admin account if the password in Plesk?

Unable to connect to database
login.php3: Unable to connect to database: Permission denied
ERROR 1045: Access denied for user: ‘admin@localhost’ (Using password: YES)

First try to restart Parallels Plesk Panel:

# /etc/init.d/psa restart

Check that the /etc/psa/.psa.shadow file has valid permissions. The right permissions would be

# ls -la /etc/psa/.psa.shadow
-rw——- 1 psaadm psaadm 5 Feb 26 11:22 /etc/psa/.psa.shadow

In case you have any other permission, you should change it using the following command:

# chown psaadm:psaadm /etc/psa/.psa.shadow
# chmod 600 /etc/psa/.psa.shadow

Check that Mysql server is running and working properly using the “ps ax | grep mysql” command. For example:

# ps ax | grep mysql

To check that Mysql server is running fine, try to access to the mysql console. For example:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa

In the newest versions of Parallels Plesk Panel, the password can be restored using the “ch_admin_passwd” utility.

# /usr/local/psa/admin/sbin/ch_admin_passwd –help

To change the password, use a command like the following one:

# export PSA_PASSWORD=’NEW_PASSWORD’ ; /usr/local/psa/admin/sbin/ch_admin_passwd; unset PSA_PASSWORD

Load MySQL with ’skip-grant-tables’ option, adding skip-grant-tables to the [mysqld] section of /etc/my.cnf file

Restart MySQL with the following command prompt:

# /etc/init.d/mysqld restart

Add the new password to the /etc/psa/.psa.shadow file.

Repair the password using the following command prompt:

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

Delete skip-grant-tables option from /etc/my.cnf

Restart MySQL.

Reference: http://parallels.com/

One Response to “How can I change/repair my Admin account if the password in Plesk?”

  1. 2masturbatingon 12 Jan 2022 at 9:20 pm

    3stepfather…

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.