2017-05-08 17:50:19 +02:00
|
|
|
###
|
|
|
|
### Copy createdb.sql.example to createdb.sql
|
2017-05-13 15:37:25 +02:00
|
|
|
### then uncomment then set database name and username to create you need databases
|
|
|
|
#
|
|
|
|
# example: .env MYSQL_USER=appuser and need db name is myshop_db
|
|
|
|
#
|
|
|
|
# CREATE DATABASE IF NOT EXISTS `myshop_db` ;
|
|
|
|
# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ;
|
|
|
|
#
|
2017-05-08 17:50:19 +02:00
|
|
|
###
|
2017-05-13 15:37:25 +02:00
|
|
|
### this sql script is auto run when percona container start and $DATA_SAVE_PATH/percona not exists.
|
|
|
|
###
|
|
|
|
### if your $DATA_SAVE_PATH/percona is exists and you do not want to delete it, you can run by manual execution:
|
|
|
|
###
|
|
|
|
### docker-compose exec percona bash
|
|
|
|
### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql
|
|
|
|
###
|
|
|
|
|
|
|
|
#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ;
|
|
|
|
#GRANT ALL ON `dev_db_1`.* TO 'homestead'@'%' ;
|
|
|
|
|
|
|
|
#CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ;
|
|
|
|
#GRANT ALL ON `dev_db_2`.* TO 'homestead'@'%' ;
|
|
|
|
|
|
|
|
#CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ;
|
|
|
|
#GRANT ALL ON `dev_db_3`.* TO 'homestead'@'%' ;
|
2017-05-08 17:50:19 +02:00
|
|
|
|
2017-05-13 15:37:25 +02:00
|
|
|
FLUSH PRIVILEGES ;
|