#/bin/sh

# A simple script to create and initialize RRCC database
#
# Edit the following variables according to your setup
# before running this script.

DBUSER=username
DBPASSWORD=password
DBHOST=localhost
DBPORT=3306
DBNAME='rrcc'




mysql -u$DBUSER -p$DBPASSWORD -h$DBHOST -P$DBPORT -e "CREATE DATABASE $DBNAME"

mysql -u$DBUSER -p$DBPASSWORD -h$DBHOST -P$DBPORT $DBNAME < SCHEMA

if [ $? -ne 0 ]
 then echo There were problems with creating the database. Please fix them and retry.
 else echo $DBNAME database is created successfully.
fi

