Knexを使っていたのですがMySQL8にバージョンを変更してみたところ以下のようなエラーが出るようになりました。
clientがmysql
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
clientがmysql2
Error: Client does not support authentication protocol requested by server; consider upgrading MySQL client
設定をcaching_sha2_passwordから今まで通りのmysql_native_passwordに変更を行えば良いのですが、どうせならデフォルトの設定で頑張りたい。
caching_sha2_passwordに対応されているKnexで使えるnodeのクライアントはまだなさそう。
PRが出ていたのでので試してみました。
npm install ruiquelhas/mysql#feature/caching-sha2-password
とりあえずエラーは出なくなり使うことができました。