0

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
  • 109,363
  • 18
  • 175
  • 245
Ponzaro
  • 3
  • 1
  • 3
  • possible duplicate of [How to reset or recover admin account password for MySQL?](http://serverfault.com/questions/4309/how-to-reset-or-recover-admin-account-password-for-mysql) – Deer Hunter Apr 28 '15 at 08:35

2 Answers2

0

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,619
  • 1
  • 10
  • 14
-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
  • 6,964
  • 2
  • 20
  • 24