Reputation: 431
I'm using WAMP and I accidentally disable the DELETE
privilege from phpMyAdmin
GUI.
I have tried many ways like mysql_upgrade
and change password. However, I still get the error #1045: Access denied for user root@localhost
when I am trying to add the DELETE
privilege.
How can I grant the full privileges back to root@localhost?
Upvotes: 2
Views: 13362
Reputation: 548
Something like this should work for you:
skip-grant-tables
in my.cnf file under the [mysqld] section or otherwise stop mysqld and start it with the --skip-grant-tables option.mysql
to connect to DB without password without -pThen execute this:
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';
FLUSH PRIVILEGES;
Then execute:
GRANT ALL ON *.* TO 'root'@'localhost';
Upvotes: 5
Reputation: 4294
Edit your my.ini configuration file usually located at Drive:\wamp\bin\mysql\mysql-x.x\my.ini
Add this line in the [mysql]
section:
[mysqld]
skip-grant-tables
Restart your MySQL server and restore the user permissions, after that remove that line and restart MySQL.
Upvotes: 0