2017-07-04 05:01:18 +02:00
|
|
|
#
|
|
|
|
# Copy createdb.sql.example to createdb.sql
|
|
|
|
# then uncomment then set database name and username to create you need databases
|
2017-05-11 03:02:54 +02:00
|
|
|
#
|
2018-09-15 15:16:37 +02:00
|
|
|
# example: .env MYSQL_USER=appuser and needed db name is myshop_db
|
2017-05-11 03:02:54 +02:00
|
|
|
#
|
|
|
|
# CREATE DATABASE IF NOT EXISTS `myshop_db` ;
|
|
|
|
# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ;
|
|
|
|
#
|
2017-07-04 05:01:18 +02:00
|
|
|
#
|
2018-04-05 15:43:22 +02:00
|
|
|
# this sql script will auto run when the mysql container starts and the $DATA_PATH_HOST/mysql not found.
|
2017-07-04 05:01:18 +02:00
|
|
|
#
|
2018-04-05 15:43:22 +02:00
|
|
|
# if your $DATA_PATH_HOST/mysql exists and you do not want to delete it, you can run by manual execution:
|
2017-07-04 05:01:18 +02:00
|
|
|
#
|
|
|
|
# docker-compose exec mysql bash
|
|
|
|
# mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql
|
|
|
|
#
|
2017-05-11 03:02:54 +02:00
|
|
|
|
|
|
|
#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ;
|
|
|
|
#GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ;
|
|
|
|
|
|
|
|
#CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ;
|
|
|
|
#GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ;
|
|
|
|
|
|
|
|
#CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ;
|
|
|
|
#GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ;
|
2017-05-08 16:26:10 +02:00
|
|
|
|
2017-05-11 03:02:54 +02:00
|
|
|
FLUSH PRIVILEGES ;
|