The following works for MYSQL 5.6.
Here’s a way to reset the mysql root password without PHPMyAdmin.
- Start Mysql server
- Got to <xampp install path>/mysql/bin
- Write the following into a text file named tmp.txt, all in one line:
UPDATE mysql.user SET Password=PASSWORD('NewPassword') WHERE User='root' AND Host='localhost';
- From the bin directory, type in the following command:
mysqld --inti-file=tmp.txt --console
- The –console extension will display all messages to the console instead of log file.
In case something goes wrong, you could correct it.
- Stop mysql server. This will prompt mysqld to end execution.
- Restart mysql server.
- Test reset password by trying to login as root:
mysql --host=localhost --user=root -p (type in password)