createdb.sql.example 994 B

12345678910111213141516171819202122232425262728
  1. #
  2. # Copy createdb.sql.example to createdb.sql
  3. # then uncomment then set database name and username to create you need databases
  4. #
  5. # example: .env MYSQL_USER=appuser and needed db name is myshop_db
  6. #
  7. # CREATE DATABASE IF NOT EXISTS `myshop_db` ;
  8. # GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ;
  9. #
  10. #
  11. # this sql script will auto run when the mysql container starts and the $DATA_PATH_HOST/mysql not found.
  12. #
  13. # if your $DATA_PATH_HOST/mysql exists and you do not want to delete it, you can run by manual execution:
  14. #
  15. # docker-compose exec mysql bash
  16. # mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql
  17. #
  18. #CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ;
  19. #GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ;
  20. #CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ;
  21. #GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ;
  22. #CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ;
  23. #GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ;
  24. FLUSH PRIVILEGES ;