Created
August 29, 2018 06:21
-
-
Save shhider/7ff1a0d337a2821b3559a8323bad78b6 to your computer and use it in GitHub Desktop.
reset mysql password
This file contains 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
# if you remember current password: | |
mysql -u root -p | |
set password for 'root'@'localhost' = PASSWORD('your-new-password'); | |
flush privileges; | |
# else: | |
# 1. stop mysql | |
# 2. | |
sudo /usr/local/mysql/bin/mysql_safe --skip-grant-tables | |
# 3. open new terminal tab | |
# 4. | |
mysql -u root | |
# 5. | |
set password for 'root'@'localhost' = PASSWORD('your-new-password'); | |
flush privileges; | |
# 6. stop mysql_safe, and restart mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment