Skip to content

Instantly share code, notes, and snippets.

@lemenkov
Last active February 17, 2016 09:03
Show Gist options
  • Save lemenkov/11031627 to your computer and use it in GitHub Desktop.
Save lemenkov/11031627 to your computer and use it in GitHub Desktop.
How to restore/reset MySQL password
/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
mysql> FLUSH PRIVILEGES;
^D
killall mysqld
/etc/init.d/mysqld start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment