Skip to content

Commit

Permalink
Fix MySQL Docker container in Koa test app
Browse files Browse the repository at this point in the history
The MySQL database container failed to start. It failed with this error:

> unknown variable 'default-authentication-plugin=mysql_native_password'

This is due to the untagged `mysql` image being updated to MySQL 8.4.

Replacing it with `--mysql-native-password=ON`, as described in the
[MySQL 8.4 changelog][changelog], runs into a different issue, where
the `mysql` npm package does not support the newer MySQL authentication
mechanisms.

The `mysql` npm package is de facto deprecated in lieu of the `mysql2`
npm package. There has been an outstanding [open PR][pr] for the last
five years, which is very unlikely to be merged.

This commit locks the MySQL version to 8.3, which is the last version
that still supports the now deprecated authentication mechanisms, and
therefore the last version that will be compatible with the `mysql`
npm package.

[skip changeset]

[changelog]: https://dev.mysql.com/doc/refman/8.4/en/mysql-nutshell.html
[pr]: mysqljs/mysql#2233

Co-authored-by: Noemi Lapresta <noemi@appsignal.com>
  • Loading branch information
tombruijn and unflxw committed May 6, 2024
1 parent ef792a5 commit 0586d60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/koa-mysql/docker-compose.yml
Expand Up @@ -2,7 +2,7 @@ version: "3.8"

services:
mysql:
image: mysql
image: mysql:8.3
command: --default-authentication-plugin=mysql_native_password
restart: always
env_file:
Expand Down

0 comments on commit 0586d60

Please sign in to comment.