Skip to content

Instantly share code, notes, and snippets.

@srmklive
Created October 31, 2018 21:22
Show Gist options
  • Save srmklive/c9105f88d130f7eb5d9b713ed87d2023 to your computer and use it in GitHub Desktop.
Save srmklive/c9105f88d130f7eb5d9b713ed87d2023 to your computer and use it in GitHub Desktop.
(How i fixed) SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
1. First edit the mysql config e.g. /etc/mysql/my.cnf & added the following:
[mysqld]
default_authentication_plugin= mysql_native_password
2. Then run the following command:
mysql_upgrade -u root -p --default-auth=mysql_native_password
3. If above command succeeds, then login into mysql server:
mysql -u root -p
4. Lastly the update password for the user you want to change:
ALTER USER 'myuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment