ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

nestjsでmysqlにアクセスできない

ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client が発生してnestjsのアプリが起動できない状況になった。

  • 環境 ubuntu 18.4 mysql 8 nodejs 10

 対策

認証方法をmysqk_native_passwordに変更する

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourRootPassword';
-- or
CREATE USER 'foo'@'%' IDENTIFIED WITH mysql_native_password BY 'bar';


FLUSH PRIVILEGES;