From c28013f40f5779a11e60ac84dae0dea5fc2ed673 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Fri, 20 Dec 2024 18:43:46 +0900 Subject: [PATCH] Fixed warning messages on Alpine (mysql->mariadb) during SQL queries --- Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh | 8 ++++---- Dockerfiles/server-mysql/alpine/docker-entrypoint.sh | 8 ++++---- Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh | 4 ++-- Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh index ce771b0b0..c7db68fe0 100755 --- a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh @@ -254,8 +254,8 @@ check_db_connect_mysql() { export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" - while [ ! "$(mysqladmin ping $mysql_connect_args -u ${DB_SERVER_ROOT_USER} \ - --silent --connect_timeout=10 $ssl_opts)" ]; do + while [ ! "$(mariadb-admin ping $mysql_connect_args -u ${DB_SERVER_ROOT_USER} \ + --silent --skip-ssl-verify-server-cert --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done @@ -271,7 +271,7 @@ mysql_query() { export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" - result=$(mysql --silent --skip-column-names $mysql_connect_args \ + result=$(mariadb --silent --skip-column-names --skip-ssl-verify-server-cert $mysql_connect_args \ -u ${DB_SERVER_ROOT_USER} -e "$query" $ssl_opts) unset MYSQL_PWD @@ -292,7 +292,7 @@ exec_sql_file() { command="zcat" fi - $command "$sql_script" | mysql --silent --skip-column-names \ + $command "$sql_script" | mariadb --silent --skip-column-names --skip-ssl-verify-server-cert \ --default-character-set=${DB_CHARACTER_SET} \ $mysql_connect_args \ -u ${DB_SERVER_ROOT_USER} $ssl_opts \ diff --git a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh index 924bf52ba..4dd835439 100755 --- a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh @@ -251,8 +251,8 @@ check_db_connect_mysql() { export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" - while [ ! "$(mysqladmin ping $mysql_connect_args -u ${DB_SERVER_ROOT_USER} \ - --silent --connect_timeout=10 $ssl_opts)" ]; do + while [ ! "$(mariadb-admin ping $mysql_connect_args -u ${DB_SERVER_ROOT_USER} \ + --silent --skip-ssl-verify-server-cert --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done @@ -268,7 +268,7 @@ mysql_query() { export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" - result=$(mysql --silent --skip-column-names $mysql_connect_args \ + result=$(mariadb --silent --skip-column-names --skip-ssl-verify-server-cert $mysql_connect_args \ -u ${DB_SERVER_ROOT_USER} -e "$query" $ssl_opts) unset MYSQL_PWD @@ -289,7 +289,7 @@ exec_sql_file() { command="zcat" fi - $command "$sql_script" | mysql --silent --skip-column-names \ + $command "$sql_script" | mariadb --silent --skip-column-names --skip-ssl-verify-server-cert \ --default-character-set=${DB_CHARACTER_SET} \ $mysql_connect_args \ -u ${DB_SERVER_ROOT_USER} $ssl_opts \ diff --git a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh index d75d9c9b5..d8beb4e41 100755 --- a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh @@ -123,8 +123,8 @@ check_db_connect() { export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping $mysql_connect_args -u ${DB_SERVER_ZBX_USER} \ - --silent --connect_timeout=10 $ssl_opts)" ]; do + while [ ! "$(mariadb-admin ping $mysql_connect_args -u ${DB_SERVER_ZBX_USER} \ + --silent --skip-ssl-verify-server-cert --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh index 3290183c8..efd4ec9cc 100755 --- a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -126,8 +126,8 @@ check_db_connect() { export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping $mysql_connect_args -u ${DB_SERVER_ZBX_USER} \ - --silent --connect_timeout=10 $ssl_opts)" ]; do + while [ ! "$(mariadb-admin ping $mysql_connect_args -u ${DB_SERVER_ZBX_USER} \ + --silent --skip-ssl-verify-server-cert --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done