@@ -350,7 +350,7 @@ imagePullSecrets:
350350{{- define " drupal.wait-for-db-command" }}
351351TIME_WAITING= 0
352352echo " Waiting for database." ;
353- until mysqladmin status --connect-timeout= 2 -u $DB_USER -p$DB_PASS -h $DB_HOST -P $ {DB_PORT:-3306} --silent; do
353+ until mariadb-admin status --connect-timeout= 2 -u $DB_USER -p$DB_PASS -h $DB_HOST -P $ {DB_PORT:-3306} --silent; do
354354 echo -n " ."
355355 sleep 5
356356 TIME_WAITING= $ ((TIME_WAITING+5))
363363{{- end }}
364364
365365{{- define " drupal.create-db" }}
366- mysql -u $DB_USER -p$DB_PASS -h $DB_HOST -P $ {DB_PORT:-3306} -e " CREATE DATABASE IF NOT EXISTS $DB_NAME;"
366+ mariadb -u $DB_USER -p$DB_PASS -h $DB_HOST -P $ {DB_PORT:-3306} -e " CREATE DATABASE IF NOT EXISTS $DB_NAME;"
367367{{- end }}
368368
369369{{- define " drupal.wait-for-elasticsearch-command" }}
@@ -490,11 +490,11 @@ if [[ "$(drush status --fields=bootstrap)" = *'Successful'* ]] ; then
490490 /tmp/db.sql \
491491 '/-- Table structure for table/-1' \
492492 '{*}'
493- # First file is the mysqldump header, rename it to " header"
493+ # First file is the mariadb-dump header, rename it to " header"
494494 mv table-0000 header
495495 # Find last table file
496496 last_table= $ (find -type f -name 'table-*' | sort -n | tail -n1)
497- # Split last table file to extract mysqldump footer, which starts with a line including " @OLD_"
497+ # Split last table file to extract mariadb-dump footer, which starts with a line including " @OLD_"
498498 csplit \
499499 --silent \
500500 --prefix= 'last-' \
@@ -565,12 +565,12 @@ if [ "${REF_DATA_COPY_DB:-}" == "true" ]; then
565565
566566 if [[ " $import_method" == " parallel" ]]; then
567567 echo " Importing SQL files in parallel. This setting can be changed in silta.yml using the referenceData.databaseImportMethod key."
568- find " ${tmp_ref_data}/" -type f -name " *.sql" | xargs -P10 -I{} sh -c 'echo " Importing {}" && mysql -A --user= " ${DB_USER}" --password= " ${DB_PASS}" --host= " ${DB_HOST}" " ${DB_NAME}" < {}'
568+ find " ${tmp_ref_data}/" -type f -name " *.sql" | xargs -P10 -I{} sh -c 'echo " Importing {}" && mariadb -A --user= " ${DB_USER}" --password= " ${DB_PASS}" --host= " ${DB_HOST}" " ${DB_NAME}" < {}'
569569 pipeline_exit_code= $ ? # Capture exit code of the pipeline (most likely influenced by xargs)
570570
571571 # Check if xargs reported an error (any non-zero exit status)
572572 if [ " $pipeline_exit_code" -ne 0 ]; then
573- echo " ERROR: One or more parallel imports failed. Check the logs above for specific mysql errors."
573+ echo " ERROR: One or more parallel imports failed. Check the logs above for specific mariadb errors."
574574 exit 1
575575 fi
576576
@@ -580,8 +580,8 @@ if [ "${REF_DATA_COPY_DB:-}" == "true" ]; then
580580 echo " Importing SQL files sequentially. This setting can be changed in silta.yml using the referenceData.databaseImportMethod key."
581581 find " ${tmp_ref_data}/" -type f -name " *.sql" | sort | while IFS= read -r sql_file; do
582582 echo " Importing ${sql_file}"
583- if ! mysql -A --user= " ${DB_USER}" --password= " ${DB_PASS}" --host= " ${DB_HOST}" " ${DB_NAME}" < " ${sql_file}" ; then
584- echo " ERROR: Failed to import ${sql_file}. Check the logs above for specific mysql errors."
583+ if ! mariadb -A --user= " ${DB_USER}" --password= " ${DB_PASS}" --host= " ${DB_HOST}" " ${DB_NAME}" < " ${sql_file}" ; then
584+ echo " ERROR: Failed to import ${sql_file}. Check the logs above for specific mariadb errors."
585585 exit 1
586586 fi
587587 done
658658
659659 # Take a database dump.
660660 echo "Starting database backup."
661- /usr/bin/mysqldump -u $DB_USER --password=$DB_PASS -h $DB_HOST --skip-lock-tables --single-transaction --max_allowed_packet=1G --quick $IGNORE_TABLES $DB_NAME > /tmp/db.sql
662- /usr/bin/mysqldump -u $DB_USER --password=$DB_PASS -h $DB_HOST --skip-lock-tables --single-transaction --max_allowed_packet=1G --quick --force --no-data $DB_NAME $IGNORED_TABLES >> /tmp/db.sql
661+ /usr/bin/mariadb-dump -u $DB_USER --password=$DB_PASS -h $DB_HOST --skip-lock-tables --single-transaction --max_allowed_packet=1G --quick $IGNORE_TABLES $DB_NAME > /tmp/db.sql
662+ /usr/bin/mariadb-dump -u $DB_USER --password=$DB_PASS -h $DB_HOST --skip-lock-tables --single-transaction --max_allowed_packet=1G --quick --force --no-data $DB_NAME $IGNORED_TABLES >> /tmp/db.sql
663663 echo "Database backup complete."
664664{{- end }}
665665
728728 TIME_WAITING=0
729729 echo "Waiting for database.";
730730
731- until mysqladmin status --connect-timeout=2 -u $DB_USER -p$DB_PASS -h $DB_HOST --protocol=tcp --silent; do
731+ until mariadb-admin status --connect-timeout=2 -u $DB_USER -p$DB_PASS -h $DB_HOST --protocol=tcp --silent; do
732732 echo -n "."
733733 sleep 1s
734734 TIME_WAITING=$((TIME_WAITING+1))
740740 done
741741
742742 echo "Importing database dump for validation"
743- mysql -u $DB_USER -p$DB_PASS $DB_NAME -h $DB_HOST --protocol=tcp --max_allowed_packet=1G < /tmp/db.sql
743+ mariadb -u $DB_USER -p$DB_PASS $DB_NAME -h $DB_HOST --protocol=tcp --max_allowed_packet=1G < /tmp/db.sql
744744 drush status --fields=bootstrap
745745
746746{{- end }}
0 commit comments