By default, when you install XAMPP in your windows machine, the ‘root’ password for the MySQL is set to empty. But this is not recommended, as the MySQL database without a password will be accessible to everyone. To avoid this, a proper/secure password must be set to the user ‘root‘. To do it in XAMPP, there are two ways – the easy one and the little-tough one. We’ll first see the former.
Easy way to reset MySQL ‘root’ password in XAMPP:
After you started your XAMPP server, go to the browser and type the URL http://localhost/security/ (incase you’ve modified XAMPP server port, you need to include that port number also in previous URL). The security page will be shown where you can change the ‘root’ password for MySQL. This will update the phpMyAdmin config also.
Little-tough way of resetting the ‘root’ user password in MySQL:
- Start the Apache Server and MySQL instances from the XAMPP control panel.
- After the server started, open any web browser and give http://localhost:8090/phpmyadmin/ (if you are running XAMPP on 8090 port). This will open the phpMyAdmin interface. Using this interface we can manager the MySQL server from the web browser.
- In the phpMyAdmin window, select SQL tab from the right panel. This will open the SQL tab where we can run the SQL queries.
- Now type the following query in the textarea and click Go
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
FLUSH PRIVILEGES; - Now you will see a message saying that the query has been executed successfully.
- If you refresh the page, you will be getting a error message. This is because the phpMyAdmin configuration file is not aware of our newly set root passoword. To do this we have to modify the phpMyAdmin config file.
Modifying phpMyAdmin config file:
- Open the file [XAMPP Installation Path] / phpmyadmin / config.inc.php in your favorite text editor.
- Search for the string $cfg['Servers'][$i]['password'] = ”; and change it to like this, $cfg['Servers'][$i]['password'] = ‘password’; Here the ‘password’ is what we set to the ‘root’ user using the SQL query.
- Now all set to go. Save the config.inc.php file and restart the XAMPP server.
{ 14 comments… read them below or add one }
bravo, thank you so much, this is the only tutorial i fond that actually somehow successfully worked my phpmyadmin client.
Very nice Good job.
Tnx a lot
Thanx. Works well, but … is the “restart XAMPP” step at the end of the process really needed ?
In my case it didn’t.
Thanx again
Hi Marco,
In my case, I had to restart XAMPP server, since I’d modified the phpMyAdmin config file and the server didn’t pickup the changes without restarting it.
Thanks
thx vry much
hi,
Really..Very Useful.Thx Dude..
hi dear:i was using vertrigo with editor dreamweaver.all was working very well but when i installed xampp and joomla then all vertrigo stopped working and phpmyadmin did not opened and all databases that were made in mysql are not appearing.
plz help me as early as possible.
@qaiser
from your comment, I guess the problem might be because of port conflicts. If XAMPP and the other applications try to use same port, then these kind of problems may occur.
Please try changing XAMPP password and see if everything works fine.
Thank a lot.
Thanx. Works well, but … is the “restart XAMPP” step at the end of the process really needed ?
In my case it didn't.
Thanx again
Hi Veerasundar,
Thanks a lot
Like this…
{ 2 trackbacks }