From 4c502ce68dd2241664a2b98372d1d716216be39a Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 11 May 2023 12:11:51 +1000 Subject: [PATCH] 10.3 simplification --- 10.10/docker-entrypoint.sh | 12 +----------- 10.11/docker-entrypoint.sh | 12 +----------- 10.4/docker-entrypoint.sh | 12 +----------- 10.5/docker-entrypoint.sh | 12 +----------- 10.6/docker-entrypoint.sh | 12 +----------- 10.9/docker-entrypoint.sh | 12 +----------- 11.0/docker-entrypoint.sh | 12 +----------- 11.1/Dockerfile | 2 +- 11.1/docker-entrypoint.sh | 12 +----------- 11.2/docker-entrypoint.sh | 12 +----------- docker-entrypoint.sh | 12 +----------- update.sh | 3 +-- 12 files changed, 12 insertions(+), 113 deletions(-) diff --git a/10.10/docker-entrypoint.sh b/10.10/docker-entrypoint.sh index ebb0108..5a3fb60 100755 --- a/10.10/docker-entrypoint.sh +++ b/10.10/docker-entrypoint.sh @@ -353,16 +353,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -441,8 +433,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/10.11/docker-entrypoint.sh b/10.11/docker-entrypoint.sh index ebb0108..5a3fb60 100755 --- a/10.11/docker-entrypoint.sh +++ b/10.11/docker-entrypoint.sh @@ -353,16 +353,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -441,8 +433,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/10.4/docker-entrypoint.sh b/10.4/docker-entrypoint.sh index a37faee..07dc13e 100755 --- a/10.4/docker-entrypoint.sh +++ b/10.4/docker-entrypoint.sh @@ -352,16 +352,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -440,8 +432,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/10.5/docker-entrypoint.sh b/10.5/docker-entrypoint.sh index b9f7325..750afe8 100755 --- a/10.5/docker-entrypoint.sh +++ b/10.5/docker-entrypoint.sh @@ -352,16 +352,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -440,8 +432,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/10.6/docker-entrypoint.sh b/10.6/docker-entrypoint.sh index ebb0108..5a3fb60 100755 --- a/10.6/docker-entrypoint.sh +++ b/10.6/docker-entrypoint.sh @@ -353,16 +353,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -441,8 +433,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/10.9/docker-entrypoint.sh b/10.9/docker-entrypoint.sh index ebb0108..5a3fb60 100755 --- a/10.9/docker-entrypoint.sh +++ b/10.9/docker-entrypoint.sh @@ -353,16 +353,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -441,8 +433,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/11.0/docker-entrypoint.sh b/11.0/docker-entrypoint.sh index 52f111b..a0f607f 100755 --- a/11.0/docker-entrypoint.sh +++ b/11.0/docker-entrypoint.sh @@ -353,16 +353,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -441,8 +433,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/11.1/Dockerfile b/11.1/Dockerfile index 4c129aa..07e7cfb 100644 --- a/11.1/Dockerfile +++ b/11.1/Dockerfile @@ -82,7 +82,7 @@ LABEL org.opencontainers.image.authors="MariaDB Community" \ ARG MARIADB_VERSION=1:11.1.0+maria~ubu2204 ENV MARIADB_VERSION $MARIADB_VERSION # release-status:Alpha -# release-support-type:Unknown +# release-support-type:Short Term Support # (https://downloads.mariadb.org/rest-api/mariadb/) # Allowing overriding of REPOSITORY, a URL that includes suite and component for testing and Enterprise Versions diff --git a/11.1/docker-entrypoint.sh b/11.1/docker-entrypoint.sh index 52f111b..a0f607f 100755 --- a/11.1/docker-entrypoint.sh +++ b/11.1/docker-entrypoint.sh @@ -353,16 +353,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -441,8 +433,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/11.2/docker-entrypoint.sh b/11.2/docker-entrypoint.sh index 52f111b..a0f607f 100755 --- a/11.2/docker-entrypoint.sh +++ b/11.2/docker-entrypoint.sh @@ -353,16 +353,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -441,8 +433,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index a01546a..4f9c6a6 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -353,16 +353,8 @@ docker_setup_db() { local mysqlAtLocalhostGrants= # Install mysql@localhost user if [ -n "$MARIADB_MYSQL_LOCALHOST_USER" ]; then - local pw= - pw="$(pwgen --numerals --capitalize --symbols --remove-chars="'\\" -1 32)" - # MDEV-24111 before MariaDB-10.4 cannot create unix_socket user directly auth with simple_password_check - # It wasn't until 10.4 that the unix_socket auth was built in to the server. read -r -d '' mysqlAtLocalhost <<-EOSQL || true - EXECUTE IMMEDIATE IF(VERSION() RLIKE '^10\.3\.', - "INSTALL PLUGIN /*M10401 IF NOT EXISTS */ unix_socket SONAME 'auth_socket'", - "SELECT 'already there'"); - CREATE USER mysql@localhost IDENTIFIED BY '$pw'; - ALTER USER mysql@localhost IDENTIFIED VIA unix_socket; + CREATE USER mysql@localhost IDENTIFIED VIA unix_socket; EOSQL if [ -n "$MARIADB_MYSQL_LOCALHOST_GRANTS" ]; then if [ "$MARIADB_MYSQL_LOCALHOST_GRANTS" != USAGE ]; then @@ -441,8 +433,6 @@ docker_setup_db() { ${rootCreate} ${mysqlAtLocalhost} ${mysqlAtLocalhostGrants} - -- pre-10.3 only - DROP DATABASE IF EXISTS test ; -- end of securing system users, rest of init now... SET @@SESSION.SQL_LOG_BIN=@orig_sql_log_bin; -- create users/databases diff --git a/update.sh b/update.sh index 9814c27..993bb87 100755 --- a/update.sh +++ b/update.sh @@ -6,7 +6,6 @@ set -Eeuo pipefail defaultSuite='jammy' declare -A suites=( - [10.3]='focal' [10.4]='focal' [10.5]='focal' [10.6]='focal' @@ -59,7 +58,7 @@ update_version() # Start using the new executable names case "$version" in - 10.3 | 10.4) + 10.4) sed -i -e '/--old-mode/d' \ -e 's/REPLICATION REPLICA/REPLICATION SLAVE/' \ -e 's/START REPLICA/START SLAVE/' \