In this blog, I will show you how to reset the root password for MySQL Server. On the Linux server, I have added a user name for myself and I allowed myself to be able to sudo. To add myself as a new user, type:
usermod -aG sudo,adm chuong
First, open two SSH connections to the MySQL Server.
In the first SSH connection windows, type:
service mysql stop
sudo mysqld_safe –skip-grant-tables –skip-syslog –skip-networking
In the second SSH connection windows, type:
mysql –u root
UPDATE mysql.user SET Password=PASSWORD(‘MYPASSWORD’) WHERE User=’root';
Now Quit MySQL Safe mode and start the MySQL server:
sudo service mysql start
Now we are able to access MySQL.
In this blog post, I have shown you how to reset the root password for MySQL Server.