How to Reset Mysql Password on CentOS | Linux Full Tutorial 2020

Published: 04 April 2020
on channel: Linux Teaching House
244
1

Welcome to the video - "How to Reset Mysql Password on CentOS | Linux Full Tutorial 2020"
In This video I am showing you How to reset MySql Password on CentOS 5/6/7

If you have forgotten your MySQL root password, you can reset it on CentOS Linux by following these steps:

Stop the MySQL service using the following command:

arduino
Copy code
sudo systemctl stop mysqld
Start MySQL in safe mode, skipping the authentication process using the following command:

css
Copy code
sudo mysqld_safe --skip-grant-tables &
Log in to MySQL as the root user using the following command:

Copy code
mysql -u root
Set a new password for the root user using the following command:

sql
Copy code
UPDATE mysql.user SET authentication_string=PASSWORD('new_password') WHERE User='root';
Replace new_password with your desired new password.

Flush the privileges using the following command:

Copy code
FLUSH PRIVILEGES;
Exit MySQL using the following command:

bash
Copy code
exit
Stop the MySQL service using the following command:

arduino
Copy code
sudo systemctl stop mysqld
Start the MySQL service using the following command:

sql
Copy code
sudo systemctl start mysqld
That's it! You have successfully reset your MySQL root password on CentOS Linux. Make sure to use your new password to log in to MySQL in the future.

Regenerate response

Keep Watching this video
Please Subscribe and click the notification bell so you never miss a video
Thank You For Watching

#LinuxFullTutorial2020
#LinuxTipsandTricks2020 #LinuxServer #LinuxTeachingHouse