Merge pull request #924 from bestlong/fix-mysql-user-cant-see-other-db

Fixing create multiple db MYSQL_USER not show other databases.
This commit is contained in:
Mike Erickson 2017-05-10 19:58:42 -07:00 committed by GitHub
commit ac895209f0
1 changed files with 24 additions and 4 deletions

View File

@ -1,8 +1,28 @@
###
### Copy createdb.sql.example to createdb.sql
### then uncomment and set database name to create you need databases
### 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'@'%' ;
#
###
### this sql script is auto run when mysql container start and $DATA_SAVE_PATH/mysql not exists.
###
### if your $DATA_SAVE_PATH/mysql is exists and you do not want to delete it, you can run by manual execution:
###
### docker-compose exec mysql bash
### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql
###
#CREATE DATABASE IF NOT EXISTS `dev_db_1` ;
#CREATE DATABASE IF NOT EXISTS `dev_db_2` ;
#CREATE DATABASE IF NOT EXISTS `dev_db_3` ;
#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'@'%' ;
FLUSH PRIVILEGES ;