SEARCH:   GO
{Blog entries}
Oct 23

Written by: Javier Callico
10/23/2007  RssIcon

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"

Tags:
Categories:

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

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel