Skip to content

Commit

Permalink
mariadb not mysql in db import in docker
Browse files Browse the repository at this point in the history
refs Shell scripts to mysql not being found #185
  • Loading branch information
ccorda committed Feb 6, 2024
1 parent 33dc607 commit b108a72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions _build/db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ function db_import() {
ext=${sql##*.}

if [ $ext = "zip" ]; then
unzip -p $sql | docker exec -i $DB_CONTAINER mysql -u $WORDPRESS_DB_USER -p$WORDPRESS_DB_PASSWORD -D $WORDPRESS_DB_NAME
unzip -p $sql | docker exec -i $DB_CONTAINER mariadb -u $WORDPRESS_DB_USER -p$WORDPRESS_DB_PASSWORD -D $WORDPRESS_DB_NAME
elif [ $ext = "gz" ]; then
gunzip < $sql | docker exec -i $DB_CONTAINER mysql -u $WORDPRESS_DB_USER -p$WORDPRESS_DB_PASSWORD -D $WORDPRESS_DB_NAME
gunzip < $sql | docker exec -i $DB_CONTAINER mariadb -u $WORDPRESS_DB_USER -p$WORDPRESS_DB_PASSWORD -D $WORDPRESS_DB_NAME
else
docker exec -i $DB_CONTAINER mysql -u $WORDPRESS_DB_USER -p$WORDPRESS_DB_PASSWORD -D $WORDPRESS_DB_NAME < $sql
docker exec -i $DB_CONTAINER mariadb -u $WORDPRESS_DB_USER -p$WORDPRESS_DB_PASSWORD -D $WORDPRESS_DB_NAME < $sql
fi

# run local mods if present
file="_data/local.sql"
if [ -f "$file" ]
then
docker exec -i $DB_CONTAINER mysql -u $WORDPRESS_DB_USER -p$WORDPRESS_DB_PASSWORD -D $WORDPRESS_DB_NAME < $file
docker exec -i $DB_CONTAINER mariadb -u $WORDPRESS_DB_USER -p$WORDPRESS_DB_PASSWORD -D $WORDPRESS_DB_NAME < $file
echo "$file imported."
else
echo "$file not found."
Expand Down

0 comments on commit b108a72

Please sign in to comment.