How to reset mysql privillages and root password

Submitted by Divya on Jun 11, 2012 - 21:42


I have lost necessary privileges for my root user in xampp mysql.
How do I reset the privileges?
But the sites are working properly because I have other username with all permissions.
But the mysql phpMyAdmin page loads with root user as default.
Hence, I am not able to access databases from phpmyadmin.
How to reset the change the default login user name in phpMyAdmin or how to reset the permissions to the root user?

admin
Jun 12, 2012 - 08:14

reset xamp root password

1. Execute reset root batch file that is available in mysql root directory. i.e., xampp\mysql\resetroot.bat It will remove the root user password, if you forgot root user password you can do this. 2. To Login with the user that has privileges, or to change the default login user for phpmyadmin, edit the config file that exists in phpmyadmin root folder i.e., xampp\phpMyAdmin\config.inc.php

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Change the root into any user name you created, and set the password of the user.