How to recover mysql root password
Its very common to forgot the root password for mysql server. Here are simple steps to reset mysql root password.
Step # 1: Stop the MySQL server process.
Step # 2: Start the MySQL (mysqld) server/daemon process with the .skip-grant-tables option so that it will not prompt for password
Step # 3: Connect to mysql server as the root user
Step # 4: Setup new root password
service mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql
update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
service mysqld restart
Only drawback is that your application will be impacted while recovering root password my mysql.
No related posts.
Category: Linux













