Reputation: 1
Sorry for the layout of the question, but this is the first time I write here. I'm trying to reset my mysql root password, because I forgot it. I started MySql server with --skip-grant-tables and when I try to ALTER or UPDATE root password, these are the errors.
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.04 sec)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
But when I try to UPDATE there aren't errors, only this when I try to enter password.
mysql> UPDATE mysql.user SET authentication_string='MyNewPass' WHERE User='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Upvotes: 0
Views: 4261
Reputation: 1
Similar problem. Cause: I was qualifying as localhost instead of %.
Upvotes: 0
Reputation: 21
Try to "select * from mysql.user" and see if it gives a result. You might find that the user does not exit in the user table
Upvotes: 1