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?
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 -p Then 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';
Edit your my.ini configuration file usually located at Drive:\\wamp\\bin\\mysql\\mysql-xx\\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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.