Oct
23
Written by:
Javier Callico
10/23/2007
Follow these steps to reset the MySQL root user privileges on Windows:
1- Stop the MySQL service
2- Open a command prompt and run the following command:
D:\MySQL\MySQL Server 4.1\bin>mysqld-nt --skip-grant-tables
3- Open a new command prompt and connect to the mysqld server with this command:
D:\MySQL\MySQL Server 4.1\bin>mysql -u root
4- Issue the following statements in the mysql client:
mysql> FLUSH PRIVILEGES;
mysql> USE mysql;
mysql> REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
mysql> REPLACE INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
mysql> quit;
5- Open the windows task manager and kill the process with name mysqld-nt.exe
6- Start the MySQL service and now you will have the root privileges back :-)
Note: This article assumes that MySQL was installed on "D:\MySQL\MySQL Server 4.1"
1 comment(s) so far...
Re: How to reset the MySQL root user privileges on Windows
I've spent the last two hours searching and trying things that claim to work. this one is actually does work.
a thousand thanks to you.
By Roger S on
3/17/2009
|