How to set password to your root user in XAMPP

By default XAMPP has no password to it’s ‘root’ user but we can set password for this user by the following steps:

1. Open phpmyadmin
2. Click on SQL tab
3. Copy & paste the following query:

UPDATE mysql.user SET Password=PASSWORD('password') WHERE
 User='root';
 FLUSH PRIVILEGES;

4. Refresh the page & will get an error message

Modifying phpMyAdmin config file:
1. open xampp installation path / phpmyadmin / config.inc.php
2. Search for the string $cfg[‘Servers’][$i][‘password’] = ”;
3. it will be like: $cfg[‘Servers’][$i][‘password’] = ‘password’;
Here the ‘password’ is what we set to the ‘root’ user using the SQL
query.
4. Chnage the line:
$cfg[‘Servers’][$i][‘auth_type’] = ‘config’;
to
$cfg[‘Servers’][$i][‘auth_type’] = ‘http’;
5. Now all set to go. Save the config.inc.php file and restart the XAMPP server.

You may also like

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.