Skip to content

Instantly share code, notes, and snippets.

@marcoemorais
Created June 20, 2014 00:50
Show Gist options
  • Save marcoemorais/3ca6430f12ed9175f0bb to your computer and use it in GitHub Desktop.
Save marcoemorais/3ca6430f12ed9175f0bb to your computer and use it in GitHub Desktop.
# reset root password
o Stop MySQL
$ sudo /sbin/service mysqld stop
o Restart it manually with the skip-grant-tables option:
$ mysqld_safe --skip-grant-tables
o Run the MySQL client:
$ mysql -u root
o Reset the root password manually with this MySQL command:
mysql> UPDATE mysql.user SET Password=PASSWORD('XXX') WHERE User='root';
o Flush the privileges with this MySQL command:
mysql> FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment