Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodejs's mysql driver does not support mysql8's default auth plugin #316

Closed
wants to merge 1 commit into from

Conversation

gfx
Copy link
Collaborator

@gfx gfx commented Aug 25, 2019

提案

nodejsのmysql driverの都合でmysqlのisucari userの認証方式をmysql 5.7以前のものにしたいです。他の言語でも問題がないのであれば。他の言語で問題があるのなら別の方法を探します(最悪READMEに解決方法を書いておく、とかでもいいっちゃいいですが、ハマりどころが少ないにこしたことはないので)。

なお、この方法だと問題なく接続できることは確認しております。

理由

2019年8月現在、nodejsでメジャーなmysql driverであるところのmysqlとmysql2がmysql8でデフォルトになった新しい認証方式に対応してません(たとえばmysql moduleの場合はPRが1年以上WIPのままで、進捗が無いわけではないもののいつマージされてリリースされるか不明)。mysql8を使うならいろいろ工夫が必要なんですが、userをつくるときにlegacy方式の認証をするのが一番手っ取り早そうでした。

cf. https://stackoverflow.com/questions/50373427/node-js-cant-authenticate-to-mysql-8-0

mysql2 moduleのissue: sidorares/node-mysql2#991
mysql moduleのPR: mysqljs/mysql#2233


去年はどうだったかなあというと、MariaDBっぽい…(そうだった気はする)。最初mysql8をいれて認証できなくてトラブってよくみたらMariaDBで、MariaDBだと(去年の時点では)問題なかった、というような気がします。

https://github.com/isucon/isucon8-qualify/blob/935fc8f185b66f8c58f7a77a4a5836f70a906102/provisioning/roles/install_mariadb/tasks/main.yml

@gfx
Copy link
Collaborator Author

gfx commented Aug 25, 2019

refs. #234

@gfx
Copy link
Collaborator Author

gfx commented Aug 25, 2019

本番はmysql 5.7ということなのでこの対応は不要、と。

@gfx gfx closed this Aug 25, 2019
@gfx gfx deleted the use_legacy_auth_plugin_for_mysql8 branch August 25, 2019 07:20
@walf443 walf443 mentioned this pull request Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant