views:

187

answers:

1

I am using MySQL. My root user doesn't have all privileges. How can I get all privileges back to the root user? How to do it step by step?

+1  A: 

Log in as root, then run the following MySQL commands:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
FLUSH PRIVILEGES;
Kaleb Brasee
ErrorSQL query:GRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost';MySQL said: Documentation#1045 - Access denied for user 'root'@'localhost' (using password: YES)
Steven
You were logged in to mysql as root when you ran this, correct?
Kaleb Brasee
I wonder if you need to set the password as well, and maybe the ability to grant:GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'some_password' GRANT OPTION;
Kaleb Brasee
Yes, I was logged in to mysql as root when I ran it. I still have my password. When I run,GRANT ALL PRIVILEGES ON . TO 'root'@'localhost' IDENTIFIED BY 'my_password' GRANT OPTION; it says I have an error in my SQL syntax.
Steven