Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rajibdpi/93a555d28ba08ae3814fca4b46a8bf76 to your computer and use it in GitHub Desktop.
Save rajibdpi/93a555d28ba08ae3814fca4b46a8bf76 to your computer and use it in GitHub Desktop.
phpMyAdmin Cannot log in to the MySQL server. and it showing SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

phpMyAdmin Cannot log in to the MySQL server. and it showing SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

sudo mysql -u root
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';
or 
DROP USER root@localhost;
CREATE USER root@localhost IDENTIFIED BY 'root_password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
FLUSH PRIVILEGES;
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment