views:

76

answers:

1

I am using PhpMyadmin. I canceled some structure privileges of the user root this afternoon and I want to recover these privileges. I always log in to PhpMyAdmin with the user identity of "root". But I get an error message when I attempt to recover my all privileges.

Error

SQL query: Edit

GRANT 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
#1045 - Access denied for user 'root'@'localhost' (using password:

YES)

What's wrong? How to solve this problem?

+1  A: 

It looks like you locked your root user out from your database. To fix this you need direct access to the databases server (system'S root / Administrator acocount) and then start the MySQL server using the --skip-grant-tables option. Then MySQL won't check the user rights so you can give all rights back to the root user.

Note that you should use the MySQL root account really only when it's needed, daily operations should be delegated to other users to prevent such errors in future.

johannes
How to start the MySQL server using the --skip-grant-tables option?
Steven
Depends on your system ... on Linux systems something likesudo mysqld --defaults-file=/etc/my.cnf --skip-grant-tablesMight do the trick
johannes
It is windows system.
Steven
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
Martin Hohenberg