File tree Expand file tree Collapse file tree
percona/docker-entrypoint-initdb.d Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ services:
215215 - MYSQL_ROOT_PASSWORD=${PERCONA_ROOT_PASSWORD}
216216 volumes :
217217 - percona:/var/lib/mysql
218+ - ./percona/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
218219 ports :
219220 - " ${PERCONA_PORT}:3306"
220221 networks :
Original file line number Diff line number Diff line change 11###
22### Copy createdb.sql.example to createdb.sql
3- ### then uncomment and set database name to create you need databases
3+ ### then uncomment then set database name and username to create you need databases
4+ #
5+ # example: .env MYSQL_USER=appuser and need db name is myshop_db
6+ #
7+ # CREATE DATABASE IF NOT EXISTS `myshop_db` ;
8+ # GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ;
9+ #
410###
11+ ### this sql script is auto run when percona container start and $DATA_SAVE_PATH/percona not exists.
12+ ###
13+ ### if your $DATA_SAVE_PATH/percona is exists and you do not want to delete it, you can run by manual execution:
14+ ###
15+ ### docker-compose exec percona bash
16+ ### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql
17+ ###
18+
19+ #CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ;
20+ #GRANT ALL ON `dev_db_1`.* TO 'homestead'@'%' ;
21+
22+ #CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ;
23+ #GRANT ALL ON `dev_db_2`.* TO 'homestead'@'%' ;
24+
25+ #CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ;
26+ #GRANT ALL ON `dev_db_3`.* TO 'homestead'@'%' ;
527
6- #CREATE DATABASE IF NOT EXISTS `dev_db_1` ;
7- #CREATE DATABASE IF NOT EXISTS `dev_db_2` ;
8- #CREATE DATABASE IF NOT EXISTS `dev_db_3` ;
28+ FLUSH PRIVILEGES ;
You can’t perform that action at this time.
0 commit comments