Name and Version
bitnami/mysql:9.6
What steps will reproduce the bug?
Deploy MySQL Helm chart (v.14.0.3) using image v9+ (e.g. 9.4.0-debian-12-r1) with "initdbScripts" set in values.yaml.
For example - values-test.yaml:
initdbScripts:
init.sql: |
-- Broken with MySQL 9
GRANT ALL PRIVILEGES ON db1.* TO 'myuser'@'%';
FLUSH PRIVILEGES;
Install helm chart:
helm upgrade -i -n mysql test oci://registry-1.docker.io/bitnamicharts/mysql -f values-test.yaml
Pod crashes with error in log:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'source /docker-entrypoint-initdb.d/init.sql' at line 1
What is the expected behavior?
The Pod should start successfully after executing the init.sql script. This works using MySQL images v8, but it fails using v9 images.
What do you see instead?
Error in Pod:
INFO ==> Starting mysql in background
INFO ==> Loading user's custom files from /docker-entrypoint-initdb.d
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'source /docker-entrypoint-initdb.d/init.sql' at line 1
ERROR ==> Failed executing /docker-entrypoint-initdb.d/init.sql
INFO ==> Stopping mysql
Additional information
This is probably caused by this line in bitnami/mysql/9.6/debian-12/rootfs/opt/bitnami/scripts/libmysql.sh
https://github.com/bitnami/containers/blob/main/bitnami/mysql/9.6/debian-12/rootfs/opt/bitnami/scripts/libmysql.sh#L453
Command like mysql <<< "source /docker-entrypoint-initdb.d/init.sql doesn't work in MySQL v9 images.
Name and Version
bitnami/mysql:9.6
What steps will reproduce the bug?
Deploy MySQL Helm chart (v.14.0.3) using image v9+ (e.g. 9.4.0-debian-12-r1) with "initdbScripts" set in values.yaml.
For example - values-test.yaml:
Install helm chart:
helm upgrade -i -n mysql test oci://registry-1.docker.io/bitnamicharts/mysql -f values-test.yamlPod crashes with error in log:
What is the expected behavior?
The Pod should start successfully after executing the init.sql script. This works using MySQL images v8, but it fails using v9 images.
What do you see instead?
Error in Pod:
Additional information
This is probably caused by this line in bitnami/mysql/9.6/debian-12/rootfs/opt/bitnami/scripts/libmysql.sh
https://github.com/bitnami/containers/blob/main/bitnami/mysql/9.6/debian-12/rootfs/opt/bitnami/scripts/libmysql.sh#L453
Command like
mysql <<< "source /docker-entrypoint-initdb.d/init.sqldoesn't work in MySQL v9 images.