Fix: replace mysqljs with mysql2 #7590
Merged
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.
This PR replaces
mysql
withmysql2
. Learn more about some of the benefits of usingmysql2
here.The reason I am making this change is because MySQL 8.4 completely removed compatibility for the default authentication method we were using previously (mysql_native_password). If you tried to start the server with MySQL 8.4, you would receive this warning:
The
mysql
npm package is de facto deprecated in lieu of themysql2
npm package. There has been an outstanding pull request to add in the new authentication methods, but it doesn't look like this has any chance of being merged anytime soon.Note that, for docker, the plugin has been removed, but a new flag has been added
--mysql-native-password=ON
to enable the mysql-native password authentication. We'll likely need to switch off this in a future version to their SHA2 caching plugin. However, I'm not sure what that would involve at this point. Using this flag is a stopgap while we figure that out.