same problem of Accidently deleted admin on Windows 2008 server
I was wondering if anyone can help me recreating admin for MySQL 5+ under windows 2008 server !!!
ahha, I found a very good response on this link [
http://skullboxx.net/kb/node/115]
solved my problem.
Plesk Windows - Reseting the MySql Password
Submitted by Micky on Fri, 04/27/2007 - 23:49 tag(s) : Windows
Once you have logged into the server you via Remote Desktop you will need to take the following steps:
Go to 'Start >> Run' and type in 'services.msc'.
Now you will need to look for 'MySql Server' In the Services window.
Right click on 'MySql Server' and go to 'Properties'.
Once you have copied the location of the 'my.ini' file like the following example you will need to go to 'Start >> Run' and then enter in the location of the 'my.ini' file.
C:\Program Files\SWsoft\Plesk\Databases\MySQL\Data\my.ini
Under the '[mysqld]' section in the 'my.ini' file you will need to add the following line:
skip-grant-tables
Restart 'MySql Server'.
Then you will need to login to MySql:
cd C:\Program Files\SWsoft\Plesk\MySQL\bin
C:\Program Files\SWsoft\Plesk\MySQL\bin>mysql -u admin
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.1.18-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
mysql> UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit;
Then you will need to remove 'skip-grant-tables' from the my.ini file and restart 'MySql' after resaving the my.ini file.