So for the past hour I've been trying to figure out how to reset my 'root' password for MySQL as I cannot log into PHPMyAdmin. I've tried changing the password in the config.inc.php file and searching through other methods. I cannot find a successful way. A few months ago I changed it as a test password but now I forget what it was. If anyone can help, that would be great. (I'm running on a Windows computer).
To get started, launch your XAMPP Control Panel and click on the Shell button on the right-hand side. Use the XAMPP shell to change your root password. The shell will prompt you to enter a new password. Press Enter/Return again, and you'll be asked to confirm the new password.
In the mysql client, tell the server to reload the grant tables so that account-management statements work: mysql> FLUSH PRIVILEGES; Then change the 'root'@'localhost' account password. Replace the password with the password that you want to use.
Configuring a default root password for MySQL/MariaDB Use the following procedure to set a root password. To change the root password, type the following at the MySQL/MariaDB command prompt: ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyN3wP4ssw0rd'; flush privileges; exit; Store the new password in a secure location.
In order to recover the password, you simply have to follow these steps: Stop the MySQL server process with the command sudo service mysql stop. Start the MySQL server with the command sudo mysqld_safe –skip-grant-tables –skip-networking & Connect to the MySQL server as the root user with the command mysql -u root.
You want to edit this file: "\xampp\phpMyAdmin\config.inc.php"
change this line:
$cfg['Servers'][$i]['password'] = 'WhateverPassword';
to whatever your password is. If you don't remember your password, then run this command within the Shell:
mysqladmin.exe -u root password WhateverPassword
where WhateverPassword is your new password.
Steps:
7 . now open your xampp dir ( c:/xampp ) --> 8 . to phpMyadmin dir [C:\xampp\phpMyAdmin]
10 .find [ $cfg['Servers'][$i]['auth_type'] = 'config';
]line and replace 'config' to ‘cookie’
$cfg['Servers'][$i]['AllowNoPassword'] = true;
] this line change ‘true’ to ‘false’
.last : save the file .
here is a video link in case you want to see it in Action [ click Here ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With