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

Pass extra mysqld flags to mysql_install_db #168

Merged
merged 1 commit into from
May 18, 2018

Conversation

yosifkit
Copy link
Contributor

Same change as docker-library/mysql#358.

This will allow Docker for Windows/Mac users to add --innodb-flush-method=fsync and get MariaDB running with a datadir from the host.

Addresses #138. related to docker-library/percona#42

@tianon tianon merged commit 2027f88 into MariaDB:master May 18, 2018
@tianon tianon deleted the initdb-args branch May 18, 2018 21:21
@tianon
Copy link
Contributor

tianon commented May 21, 2018

Just tested on Docker for Mac, and it's fine without this (so that fsync thing is probably only necessary for Windows). 👍

tianon added a commit to infosiftr/stackbrew that referenced this pull request May 23, 2018
- `busybox`: 1.28.4
- `cassandra`: arm64v8 on 2.1 (docker-library/cassandra#147)
- `ghost`: 1.23.0
- `haproxy`: 1.8.9
- `mariadb`: extra `mysqld` flags to `mysql_install_db` (MariaDB/mariadb-docker#168)
- `mongo`: 3.6.5, 4.0.0-rc0, move 4.0-rc and 3.7 to Xenial (docker-library/mongo#275)
- `php`: remove Alpine 3.4 (docker-library/php#650), add Stretch and Alpine 3.7 variants (docker-library/php#646)
- `postgres`: 10.4, 9.3.23, 9.4.18, 9.5.13, 9.6.9
- `python`: remove Alpine 3.4, add Alpine 3.7 (docker-library/python#290)
- `rocket.chat`: 0.64.2
- `ruby`: remove Alpine 3.4, add Alpine 3.7 (docker-library/ruby#210), remove 2.2 (EOL; https://www.ruby-lang.org/en/downloads/branches/)
@jonhosmer
Copy link

This breaks when arguments like --init-connect="SOME COMMAND WITH A SPACE" are passed in. For example:

docker run -e MYSQL_DATABASE=test -e MYSQL_ROOT_PASSWORD=testpw -e MYSQL_USER=root mariadb:5.5 mysqld --init-connect='SET NAMES utf8' gives a Too many arguments error:

Initializing database
180524 16:26:09 [Note] /usr/sbin/mysqld (mysqld 5.5.60-MariaDB-1~wheezy) starting as process 162 ...
/usr/sbin/mysqld: Too many arguments (first extra is 'NAMES').
180524 16:26:09 [ERROR] Aborting
180524 16:26:09 [Note] /usr/sbin/mysqld: Shutdown complete
Installation of system tables failed!  Examine the logs in
/var/lib/mysql/ for more information.
...
Exited with code 1

The problem is actually with the mysql_install_db script which strips the quotes from the argument at line 159 (args="$args $arg").
It could easily be fixed by adding:

--init-connect=*) init-connect="\`parse_arg "$arg"\`" ;;

at line 150 of /usr/bin/mysql_install_db (in the parse_arguments() function, case "$arg" in statement), but that might be out of the scope of this Repository.
This change, however, causes that problem to surface when passing a valid mysqld arg to docker run mysqld command.

@tianon
Copy link
Contributor

tianon commented May 24, 2018 via email

@amq
Copy link

amq commented Jun 14, 2018

This is a rather critical issue, what can be done, or at least, what is the workaround?

@jonhosmer
Copy link

@amq What I did as a workaround was pin the docker image tag to mariadb:5.5.59.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants