Commit 855241d9 authored by Shao Yu Lung's avatar Shao Yu Lung

fix mariadb service create multiple db solution user can’t see other db problem.

parent ac895209
......@@ -239,6 +239,7 @@ services:
build: ./mariadb
volumes:
- ${DATA_SAVE_PATH}/mariadb:/var/lib/mysql
- ./mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
ports:
- "${MARIADB_PORT}:3306"
environment:
......
###
### 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 mariadb container start and $DATA_SAVE_PATH/mariadb not exists.
###
### if your $DATA_SAVE_PATH/mariadb is exists and you do not want to delete it, you can run by manual execution:
###
### docker-compose exec mariadb 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 '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'@'%' ;
#CREATE DATABASE IF NOT EXISTS `dev_db_1` ;
#CREATE DATABASE IF NOT EXISTS `dev_db_2` ;
#CREATE DATABASE IF NOT EXISTS `dev_db_3` ;
FLUSH PRIVILEGES ;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment