Skip to content

Instantly share code, notes, and snippets.

@kimenye
Created March 19, 2017 09:20
Show Gist options
  • Save kimenye/fb028c38f169d87a8d3c3b92cee63ac3 to your computer and use it in GitHub Desktop.
Save kimenye/fb028c38f169d87a8d3c3b92cee63ac3 to your computer and use it in GitHub Desktop.
Recovering your mysql root password
sudo /etc/init.d/mysql stop
sudo mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("secure_password") where User='root';
flush privileges;
quit
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment