1

I've changed the password for admin user of mysql in phpmyadmin and now I can't access neither my Plesk panel and neither mysql via ssh. The error it triggers is:

SQLSTATE[HY000] [1045] Access denied for user 'admin'@'localhost' (using password: YES) (Abstract.php:144)

If I enter skip-grant-tables in my.cnf, I can access Plesk, phpmyadmin and mysql via ssh, but it doesn't allow me to change password.

How can I do to regain normal access to the Plesk panel?

Thanks

EEAA
  • 110,608
Ponzaro
  • 13

2 Answers2

1

If you use --skip-grant-tables than you can't change password with set Password = PASSWORD('string'), but you can do

UPDATE mysql.user set Password = <HASHED_STRING> where User = <ADMIN_USER> AND Host = 'localhost';

You can create hashed string with following command

select PASSWORD('test');
+-------------------------------------------+ 
| PASSWORD('test')                          |
+-------------------------------------------+
| *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 |
+-------------------------------------------+
1 row in set (0,00 sec)
Navern
  • 1,639
-1

This is frequently asked question that already has an answer.

http://www.debian-administration.org/article/442/Resetting_a_forgotten_MySQL_root_password

Kondybas
  • 7,110