Skip to content

Instantly share code, notes, and snippets.

@ahmedeshaan
Created September 29, 2016 05:50
Show Gist options
  • Save ahmedeshaan/fed8ec8172aad42f539ff7116d4a3966 to your computer and use it in GitHub Desktop.
Save ahmedeshaan/fed8ec8172aad42f539ff7116d4a3966 to your computer and use it in GitHub Desktop.
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

  • sudo su

  • mysql -u root or mysqld_safe --skip-grant-tables

  • SELECT User,Host FROM mysql.user;

  • DROP USER 'root'@'localhost';

  • CREATE USER 'root'@'%' IDENTIFIED BY '';

  • use mysql

  • update user set password=PASSWORD("root") where User='root';

  • flush privileges;

  • quit;

  • service mysql restart

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