Page 1 of 1

accidentally deleted user root

PostPosted: 26. April 2010 22:19
by Jenn
hello,
i'm using xampp on my machine. firt in phpMyAdmin i accidentally deleted the user root.
now when i click on phpMyAdmin to go to my databases it gives me this error:

MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: YES)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

if i choose the Open new phpMyAdmin window and enter root and my password there it will open the phpMyAdmin. and i see the user root in privileges.

now i dont know if the user root is back and i dont understand why i can not open the phpmyadmin through xampp

plz help :?:

Re: accidentally deleted user root

PostPosted: 09. May 2013 02:29
by Force_Form
I have this exact same problem, and have not been able to solve it yet. If I find something that works I will link it back.

Re: accidentally deleted user root

PostPosted: 14. May 2013 03:13
by hackattack142
Hello,

This is fairly easy to do.

Open Notepad and paste the following into it:
Code: Select all
@echo off

echo "GRANT ALL PRIVILEGES ON *.* TO root@localhost " > CreateRoot.sql
echo "IDENTIFIED BY 'password';" >> CreateRoot.sql

C:\xampp\mysql\bin\mysqld.exe --no-defaults --bind-address=127.0.0.1 --bootstrap --console --standalone <CreateRoot.sql >nul

del CreateRoot.sql

pause

Change password to whatever password you want to set
Change the path to mysqld.exe if you did not install xampp to 'C:\xampp'

In Notepad:
1. File -> Save As..
2. Set 'File Name' to 'reset.bat'
3. Set 'Save as type' to 'All Files (*.*)'
4. Save to a location you can get to easily (say the desktop)

Now, make sure MySQL is not running and run this batch file.