mullnerz
1/12/2015 - 8:33 AM

create and restore mysql db

create database if not exists `${DB_NAME}`;
grant all privileges on `${DB_NAME}`.* TO `${DB_USERNAME}`@`localhost` identified by '123';
grant all privileges on `${DB_NAME}`.* TO `${DB_USERNAME}`@`%` identified by '123';

mysql --force --user ${DB_USERNAME} --password ${DB_PASSWORD} ${DB_NAME} < ${DB_NAME}.sql