Skip to content

Instantly share code, notes, and snippets.

@githubutilities
Created April 6, 2015 06:46
Show Gist options
  • Select an option

  • Save githubutilities/e6c0254a6a97a36c8bf2 to your computer and use it in GitHub Desktop.

Select an option

Save githubutilities/e6c0254a6a97a36c8bf2 to your computer and use it in GitHub Desktop.
MySQL restore lost password

MySQL restore lost password

killall -TERM mysqld
mysqld_safe --skip-grant-tables

mysql
> use mysql;
> update user set password=PASSWORD('your-password') where User='root';
> flush privileges;
> quit

mysql -uroot -ppassword

service mysqld restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment