To use the C:\xampp\mysql\resetroot.bat file you would need to edit the file to be able to use it in a Windows environment - currently written to use in a *nix environment and so will not do anything except produce an error message.
These posts have some of the details required to edit the resetroot.bat file that will eliminate the need to lose any of your current data:viewtopic.php?p=181829#p181829viewtopic.php?p=167128#p167128viewtopic.php?p=130759#p130759http://bravo.newnetenterprises.com/word ... -password/
There is also a detailed alternative method to be found on the MySQL Development site here:http://dev.mysql.com/doc/refman/5.0/en/ ... sions.html
Of course if you deleted the super user root then your problems will not be cured by simply resetting the user root password, you would need to recreate the user root once again then give root a new password.
Here are some instructions to restore your lost root super user and to give it a new password.First download, from the link in my signature, and extract the xamppcontrol3.exe file to your xampp installation folder, usually C:\xampp and use this new much improved Control Panel instead of the one included in the release.
The XCPv3 forum topic can be read here:
1. Stop Apache and MySQL by using the new XAMPP Control Panel v3.
2. Open a plain text editor and add the following 3 lines (nothing else) to the very top of a new page:
- Code: Select all
INSERT INTO mysql.user (Host, User, Password) VALUES('localhost', 'root', PASSWORD('newpass'));
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
Exactly as written in the code section above, you may copy and paste if you prefer but you must change newpass
to the password of your choice.
3. Save the file into the C:\xampp\mysql
folder as undoroot.sql
Change the folder location to where you have your own XAMPP installed if different from the default.
4. Go to the XCPv3 and click on the xampp-Shell
5. At the Shell #
- Code: Select all
Click on Enter which should then start the MySQL server using the init. file and the instruction it contains.Change the folder location to where you have your own XAMPP installed.
6. Next go to the XCPv3 where you should see that MySQL has started - click on the Stop button so that MySQL is no longer running.
7. Now you can Start Apache and MySQL, again using the XCPv3 and then click on the MySQL Admin button where, if all goes to plan, you should be asked for the username/password combination of root
and the new password you set in the init file undoroot.sql
You should now have access to all your databases that you had previous to accidentally deleting the root user.
Good luck and again my best wishes.