nodejs's mysql driver does not support mysql8's default auth plugin#316
Closed
nodejs's mysql driver does not support mysql8's default auth plugin#316
Conversation
Collaborator
Author
|
refs. #234 |
Collaborator
Author
|
本番はmysql 5.7ということなのでこの対応は不要、と。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
提案
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