Skip to content

Instantly share code, notes, and snippets.

@stephanie56
Last active June 18, 2020 17:50
Show Gist options
  • Save stephanie56/e24c3fed6770c517625ac6e68402733b to your computer and use it in GitHub Desktop.
Save stephanie56/e24c3fed6770c517625ac6e68402733b to your computer and use it in GitHub Desktop.
Fix mysql access denied for user 'admin'@'localhost' (using password: yes)
- Stop Mysql server
- Run `sudo mysqld_safe --skip-grant-tables`
- Enter password
- Keep the previous terminal open, start a new terminal window
- Run `mysql -u root` to log in to mysql
- Run `flush privileges;`
- Run `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';`
- Run `flush privileges;`
- Run `\q` to quit
- Turn off both terminals, open a new terminal to login to mysql with new password `mysql -uroot -p`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment