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:

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 🙂