Skip to content

Commit

Permalink
Create database only if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
esamattis committed May 10, 2019
1 parent dff15ce commit 0ef0a4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/install-wp-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ install_db() {
# fi

# create database

ret=0
echo "SHOW DATABASES" | mysql --user="$DB_USER" --password="$DB_PASS"$EXTRA| grep $DB_NAME || ret=$?

if [ "$ret" = "0" ]; then
return
fi

mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
}

Expand Down

0 comments on commit 0ef0a4c

Please sign in to comment.