Created
January 19, 2012 09:54
-
-
Save quietcricket/1639122 to your computer and use it in GitHub Desktop.
Reset MySQL 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
#stop server | |
service mysqld stop | |
#start server without checking password | |
mysqld_safe --skip-grant-tables & | |
#log into server as root and specify "mysql" is the database going to be used | |
mysql --user=root mysql | |
#update the password | |
update user set Password=PASSWORD('new-password-here') WHERE User='root'; | |
#make the changes to take effect | |
flush privileges; | |
#stop the server in safe mode | |
service mysqld stop | |
#start the server back again | |
service mysqld start | |
#log in as root | |
mysql -u root -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment