Skip to content

Instantly share code, notes, and snippets.

@shhider
Created August 29, 2018 06:21
Show Gist options
  • Save shhider/7ff1a0d337a2821b3559a8323bad78b6 to your computer and use it in GitHub Desktop.
Save shhider/7ff1a0d337a2821b3559a8323bad78b6 to your computer and use it in GitHub Desktop.
reset mysql password
# 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