From da581f9a859f230c30bb87b731fe8754de00b3aa Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 9 Feb 2022 10:17:34 +1100 Subject: [PATCH] mariadb names - use mariadb-admin and mysql (10.6+) --- 10.6/docker-entrypoint.sh | 6 +++--- 10.7/docker-entrypoint.sh | 6 +++--- 10.8/docker-entrypoint.sh | 6 +++--- update.sh | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/10.6/docker-entrypoint.sh b/10.6/docker-entrypoint.sh index 1a7f4ca..d7bb1fd 100755 --- a/10.6/docker-entrypoint.sh +++ b/10.6/docker-entrypoint.sh @@ -141,10 +141,10 @@ docker_temp_server_start() { fi } -# Stop the server. When using a local socket file mysqladmin will block until +# Stop the server. When using a local socket file mariadb-admin will block until # the shutdown is complete. docker_temp_server_stop() { - if ! MYSQL_PWD=$MARIADB_ROOT_PASSWORD mysqladmin shutdown -uroot --socket="${SOCKET}"; then + if ! MYSQL_PWD=$MARIADB_ROOT_PASSWORD mariadb-admin shutdown -uroot --socket="${SOCKET}"; then mysql_error "Unable to shut down server." fi } @@ -241,7 +241,7 @@ docker_exec_client() { if [ -n "$MYSQL_DATABASE" ]; then set -- --database="$MYSQL_DATABASE" "$@" fi - mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" + mariadb --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" } # Execute sql script, passed via stdin diff --git a/10.7/docker-entrypoint.sh b/10.7/docker-entrypoint.sh index 1a7f4ca..d7bb1fd 100755 --- a/10.7/docker-entrypoint.sh +++ b/10.7/docker-entrypoint.sh @@ -141,10 +141,10 @@ docker_temp_server_start() { fi } -# Stop the server. When using a local socket file mysqladmin will block until +# Stop the server. When using a local socket file mariadb-admin will block until # the shutdown is complete. docker_temp_server_stop() { - if ! MYSQL_PWD=$MARIADB_ROOT_PASSWORD mysqladmin shutdown -uroot --socket="${SOCKET}"; then + if ! MYSQL_PWD=$MARIADB_ROOT_PASSWORD mariadb-admin shutdown -uroot --socket="${SOCKET}"; then mysql_error "Unable to shut down server." fi } @@ -241,7 +241,7 @@ docker_exec_client() { if [ -n "$MYSQL_DATABASE" ]; then set -- --database="$MYSQL_DATABASE" "$@" fi - mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" + mariadb --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" } # Execute sql script, passed via stdin diff --git a/10.8/docker-entrypoint.sh b/10.8/docker-entrypoint.sh index 1a7f4ca..d7bb1fd 100755 --- a/10.8/docker-entrypoint.sh +++ b/10.8/docker-entrypoint.sh @@ -141,10 +141,10 @@ docker_temp_server_start() { fi } -# Stop the server. When using a local socket file mysqladmin will block until +# Stop the server. When using a local socket file mariadb-admin will block until # the shutdown is complete. docker_temp_server_stop() { - if ! MYSQL_PWD=$MARIADB_ROOT_PASSWORD mysqladmin shutdown -uroot --socket="${SOCKET}"; then + if ! MYSQL_PWD=$MARIADB_ROOT_PASSWORD mariadb-admin shutdown -uroot --socket="${SOCKET}"; then mysql_error "Unable to shut down server." fi } @@ -241,7 +241,7 @@ docker_exec_client() { if [ -n "$MYSQL_DATABASE" ]; then set -- --database="$MYSQL_DATABASE" "$@" fi - mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" + mariadb --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" } # Execute sql script, passed via stdin diff --git a/update.sh b/update.sh index a77a241..58a4968 100755 --- a/update.sh +++ b/update.sh @@ -130,6 +130,8 @@ for version in "${versions[@]}"; do sed -i -e '/^CMD/s/mysqld/mariadbd/' "$version/Dockerfile" sed -i -e 's/mysql_upgrade\([^_]\)/mariadb-upgrade\1/' \ -e 's/mysqldump/mariadb-dump/' \ + -e 's/mysqladmin/mariadb-admin/' \ + -e 's/\bmysql --protocol\b/mariadb --protocol/' \ -e 's/mysql_install_db/mariadb-install-db/' \ -e "0,/#ENDOFSUBSTITIONS/s/mysqld/mariadbd/" \ -e 's/mysql_tzinfo_to_sql/mariadb-tzinfo-to-sql/' \