Browse By

How to change root password of phpmyadmin using mysql query on Xampp localhost?

XAMPP installation sets default password empty for MySQL phpmyadmin on localhost. This is mostly recommended to set a password to the user root to make it more secure. To reset XAMPP MySQL root password through SQL, follow these below steps:

Change Root password:

  • Make sure Apache Server and MySQL instances are running.
  • Type “http://localhost/phpmyadmin/” in your browser. Use port number if you have any. e.g. http://localhost:8090/phpmyadmin
  • Select SQL tab from the right panel and run this query.
    UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';

Change PHP configuration

  • Find the below code in xampp/phpmyadmin/config.inc and open in your favourite text editor.
  • Search for $cfg[‘Servers’][$i][‘auth_type’] = ‘config’ ad replace it with $cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
  • Restart apache and phpmyadmin.

Now you should be able to access phpmyadmin using your new password 🙂

Latest Posts