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 co
For me much better way is to do it using terminal rather then PhpMyAdmin UI.
The answer is copied from "https://gist.github.com/susanBuck/39d1a384779f3d596afb19fcad6b598c" which I have tried and it works always, try it out..
Find the line [mysqld] and right below it add skip-grant-tables. Example:
[mysqld]
skip-grant-tables
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
[...etc...]
This should allow you to access MySQL if you don't know your password.
C:\xampp\mysql\bin\mysql.exe --user=root
USE mysql;
SELECT * FROM user \G;
UPDATE user SET password = PASSWORD('secret_pass') WHERE user = 'root';
UPDATE user SET password = '' WHERE user = 'root';
When you're done, run exit; to exit the MySQL command line.
Next, re-enable password checking by removing skip-grant-tables from C:\xampp\mysql\bin\my.ini.
Save changes, restart MySQL from XAMPP.