Skip to content

Commit

Permalink
Add SQL for creating users and databases
Browse files Browse the repository at this point in the history
The included script is idempotent, executed when the mysql container is initialized. This approach is borrowed from docker-library/mysql#18.

ECOM-6563
  • Loading branch information
Renzo Lucioni committed Dec 9, 2016
1 parent f259227 commit aefdd9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .dev/sql/init.sql
@@ -0,0 +1,11 @@
CREATE DATABASE IF NOT EXISTS credentials;
GRANT ALL ON credentials.* TO 'credentials001'@'%' IDENTIFIED BY 'password';

CREATE DATABASE IF NOT EXISTS discovery;
GRANT ALL ON discovery.* TO 'discov001'@'%' IDENTIFIED BY 'password';

CREATE DATABASE IF NOT EXISTS ecommerce;
GRANT ALL ON ecommerce.* TO 'ecomm001'@'%' IDENTIFIED BY 'password';

CREATE DATABASE IF NOT EXISTS programs;
GRANT ALL ON programs.* TO 'programs001'@'%' IDENTIFIED BY 'password';
1 change: 1 addition & 0 deletions docker-compose.yml
Expand Up @@ -40,6 +40,7 @@ services:
- "3306:3306"
volumes:
- ./.dev/volumes/mysql:/var/lib/mysql
- ./.dev/sql:/docker-entrypoint-initdb.d

# edX services
credentials:
Expand Down

0 comments on commit aefdd9f

Please sign in to comment.