Created
September 26, 2017 15:45
-
-
Save xiaoysh8/62cc9aeab3730e932eecfd77c950cb76 to your computer and use it in GitHub Desktop.
reset mysql root password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First things first. Log in as root and stop the mysql daemon. Now lets start up the mysql daemon and skip the grant tables which store the passwords. | |
mysqld_safe --skip-grant-tables | |
You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password. | |
mysql --user=root mysql | |
update user set Password=PASSWORD('new-password') where user='root'; | |
flush privileges; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment