Reset MySql root password (No password needed)
The day finally came, and not in a good way but I forgot my MySql root password…….
I found a quick and easy way to recover the MySql root password, and frankly it scares me how easy it is to reset the root password. You only need
sudo access and 2 min later your done and you have a new password for your MySql root user. I have tested this on
Mysql (MariaDB) v. 5.5.52 It is easily done in four simple steps.
- First stop the MySql Server.
sudo /etc/init.d/MySql stop
- Start the MySqld configuration.
sudo MySqld --skip-grant-tables &
- Login to MySql as root. (you don’t need a password here)
MySql -u root MySql
- Replace SETNEWPASSWORD with your new password!
UPDATE user SET Password=PASSWORD('SETNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
And that is it! I hope it worked for you like it did for me!