mysql:password_recovery
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mysql:password_recovery [2016/07/02 00:10] – created peter | mysql:password_recovery [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== MySQL - Password Recovery ====== | ====== MySQL - Password Recovery ====== | ||
+ | If you've forgotten your root password, you'll need Linux Root login to reset your MySQL root password. | ||
+ | |||
+ | |||
+ | First login to your Linux box as a root user, and stop the **mysqld** daemon. | ||
+ | |||
+ | <code bash> | ||
+ | service mysqld stop | ||
+ | </ | ||
+ | |||
+ | Now, start the **mysqld** daemon without the grant table bypassing authentication. | ||
+ | |||
+ | <code bash> | ||
+ | mysqld_safe --skip-grant-tables & | ||
+ | </ | ||
+ | |||
+ | |||
+ | The mysqld daemon should have started. | ||
+ | |||
+ | <code bash> | ||
+ | mysql -u root | ||
+ | mysql> use mysql | ||
+ | </ | ||
+ | |||
+ | Reset the root user password. | ||
+ | |||
+ | <code mysql> | ||
+ | mysql> update user set Password=PASSWORD(' | ||
+ | mysql> flush privileges; | ||
+ | mysql> exit; | ||
+ | </ | ||
+ | |||
+ | Restart the mysqld daemon, so that the new password will take into effect. | ||
+ | |||
+ | <code bash> | ||
+ | service mysqld restart | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Other methods to recover the MySQL root password ===== | ||
<code mysql / | <code mysql / |
mysql/password_recovery.1467418200.txt.gz · Last modified: 2020/07/15 09:30 (external edit)