#!/usr/bin/env bash export DIR="$(pwd)" export VER=$(cat versions/sqlver 2>/dev/null) cd ../../serverdata/sql-files echo Creating db and user... echo Enter mysql root password: mysql --force -u root -p <./init.sql result=$? if [ "$result" != 0 ]; then echo Password failed. Trying with sudo... sudo mysql --force -u root <./init.sql fi export CMD="mysql -u evol -pevol evol" echo Creating tables... $CMD ${DIR}/versions/sqlver fi