Skip to content

Instantly share code, notes, and snippets.

@gchumillas
Created August 5, 2018 19:18
Show Gist options
  • Save gchumillas/3ac06b5dc21bacb81520d7bac872dd1b to your computer and use it in GitHub Desktop.
Save gchumillas/3ac06b5dc21bacb81520d7bac872dd1b to your computer and use it in GitHub Desktop.
MySQL Access denied for user 'root'@'localhost'
```bash
# open the mysql terminal
sudo mysql -u root
```
```text
use mysql;
SELECT User, Host, plugin, authentication_string FROM user;
UPDATE user SET plugin='mysql_native_password', authentication_string=PASSWORD('123456') WHERE User='root';
FLUSH PRIVILEGES;
exit;
```
```bash
# restart mysql
sudo service mysql restart
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment