Product:
Search Type:

I cannot connect to Mysql database nor from PHP scripts nor from PHPMyAdmin however the password is correct. Only changes - MySQL was upgraded to 4.1 or newer version recently.

Article ID: 1758 
Last Review: Mar,26 2007
APPLIES TO:
  • Plesk 8.x for Linux/Unix

RESOLUTION

SYMPTOMS:

Newly created database users works fine, but the old ones that were created before MySQL upgrade cannot connect to it's databases due to password error.

 

CAUSE

Most probably the problem is caused by 'mysqld' using new password notation.

 

RESOLUTION

Set old_passwords option in /etc/my.cnf in [mysqld] section and restart MySQL:

   old_passwords=1  

Update passwords for the MySQL users that were created by Plesk in 'mysql' database using the command below:

echo "select dbu.login, a.password from data_bases db, db_users dbu, accounts a where db.id=dbu.db_id and dbu.account_id=a.id" | mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Ns -Dpsa | awk '{print "update user set Password=password(\x27"$2"\x27) where User=\x27"$1"\x27;"}' | mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dmysql

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields