views:

983

answers:

2

I locked my root user out from our database. I need to get all privileges back to the root user. I have my password and I can log in to MySQL. But the root user has no all privileges.

+2  A: 

Mysql has a step by step manual for doing this:

Reset mysql root password

Ikke
A: 

if this is a windows box, the simplest thing to do is to stop the servers, add skip-grant-tables to the mysql configuration file, and restart the server.

once you've fixed your permission problems, repeat the above but remove the skip-grant-tables option.

if you don't know where your configuration file is, then log in to mysql send SHOW VARIABLES LIKE '%config%' and one of the rows returned will tell you where your configuration file is.

longneck
I don't know where the configuration file is.
Steven
see my updated post. but honestly, if you're having this problem AND you don't know where your configuration file is, you should have someone more experienced fix it for you. unless this is just your personal database you're learning on, then go ahead and learn away. :)
longneck
ErrorSQL query: EditGRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;MySQL said: Documentation#1290 - The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement You see, I have logged on to MySQL with the --skip-grant-tables option. But when I attempted to get all privileges back to the root user, I failed.
Steven