├── schema.sql  
└── script  
     └── apply_schema  
          ├── base.sh  
          └── dev.sh  

base.sh

user=$1  
database=$2  
host=$3  
password=$4  

res=`schemalex "mysql://$user:$password@tcp($host:3306)/$database" ../../schema.sql`  

echo "$res"  

echo $res | mysql -u$user -p$password -h$host -D$database  

dev.sh

cd `dirname $0`  

password=$1  
./base.sh user database 127.0.0.1 password