Created
August 5, 2018 19:18
-
-
Save gchumillas/3ac06b5dc21bacb81520d7bac872dd1b to your computer and use it in GitHub Desktop.
MySQL Access denied for user 'root'@'localhost'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```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