Fixed warning messages on Alpine (mysql->mariadb) during SQL queries

This commit is contained in:
Alexey Pustovalov 2024-12-20 18:43:46 +09:00
parent 91d9a1d71e
commit 4248c7d7a5
4 changed files with 12 additions and 12 deletions

View File

@ -254,8 +254,8 @@ check_db_connect_mysql() {
export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" export MYSQL_PWD="${DB_SERVER_ROOT_PASS}"
while [ ! "$(mysqladmin ping $mysql_connect_args -u ${DB_SERVER_ROOT_USER} \ while [ ! "$(mariadb-admin ping $mysql_connect_args -u ${DB_SERVER_ROOT_USER} \
--silent --connect_timeout=10 $ssl_opts)" ]; do --silent --skip-ssl-verify-server-cert --connect_timeout=10 $ssl_opts)" ]; do
echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..."
sleep $WAIT_TIMEOUT sleep $WAIT_TIMEOUT
done done
@ -271,7 +271,7 @@ mysql_query() {
export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" 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) -u ${DB_SERVER_ROOT_USER} -e "$query" $ssl_opts)
unset MYSQL_PWD unset MYSQL_PWD
@ -292,7 +292,7 @@ exec_sql_file() {
command="zcat" command="zcat"
fi 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} \ --default-character-set=${DB_CHARACTER_SET} \
$mysql_connect_args \ $mysql_connect_args \
-u ${DB_SERVER_ROOT_USER} $ssl_opts \ -u ${DB_SERVER_ROOT_USER} $ssl_opts \

View File

@ -251,8 +251,8 @@ check_db_connect_mysql() {
export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" export MYSQL_PWD="${DB_SERVER_ROOT_PASS}"
while [ ! "$(mysqladmin ping $mysql_connect_args -u ${DB_SERVER_ROOT_USER} \ while [ ! "$(mariadb-admin ping $mysql_connect_args -u ${DB_SERVER_ROOT_USER} \
--silent --connect_timeout=10 $ssl_opts)" ]; do --silent --skip-ssl-verify-server-cert --connect_timeout=10 $ssl_opts)" ]; do
echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..."
sleep $WAIT_TIMEOUT sleep $WAIT_TIMEOUT
done done
@ -268,7 +268,7 @@ mysql_query() {
export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" 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) -u ${DB_SERVER_ROOT_USER} -e "$query" $ssl_opts)
unset MYSQL_PWD unset MYSQL_PWD
@ -289,7 +289,7 @@ exec_sql_file() {
command="zcat" command="zcat"
fi 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} \ --default-character-set=${DB_CHARACTER_SET} \
$mysql_connect_args \ $mysql_connect_args \
-u ${DB_SERVER_ROOT_USER} $ssl_opts \ -u ${DB_SERVER_ROOT_USER} $ssl_opts \

View File

@ -123,8 +123,8 @@ check_db_connect() {
export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" export MYSQL_PWD="${DB_SERVER_ZBX_PASS}"
while [ ! "$(mysqladmin ping $mysql_connect_args -u ${DB_SERVER_ZBX_USER} \ while [ ! "$(mariadb-admin ping $mysql_connect_args -u ${DB_SERVER_ZBX_USER} \
--silent --connect_timeout=10 $ssl_opts)" ]; do --silent --skip-ssl-verify-server-cert --connect_timeout=10 $ssl_opts)" ]; do
echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..."
sleep $WAIT_TIMEOUT sleep $WAIT_TIMEOUT
done done

View File

@ -126,8 +126,8 @@ check_db_connect() {
export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" export MYSQL_PWD="${DB_SERVER_ZBX_PASS}"
while [ ! "$(mysqladmin ping $mysql_connect_args -u ${DB_SERVER_ZBX_USER} \ while [ ! "$(mariadb-admin ping $mysql_connect_args -u ${DB_SERVER_ZBX_USER} \
--silent --connect_timeout=10 $ssl_opts)" ]; do --silent --skip-ssl-verify-server-cert --connect_timeout=10 $ssl_opts)" ]; do
echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..."
sleep $WAIT_TIMEOUT sleep $WAIT_TIMEOUT
done done