forked from jan/cacert-devsetup
14 lines
469 B
Bash
Executable file
14 lines
469 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -eux
|
|
|
|
mysql -h localhost -u root "-p$MYSQL_ROOT_PASSWORD" <<-EOF
|
|
CREATE database cacert CHARSET latin1 COLLATE latin1_swedish_ci;
|
|
CREATE USER $MYSQL_APP_USER@'%' IDENTIFIED BY '$MYSQL_APP_PASSWORD';
|
|
GRANT CREATE TEMPORARY TABLES ON cacert.* TO $MYSQL_APP_USER@'%';
|
|
GRANT SELECT, INSERT, UPDATE, DELETE ON cacert.* TO $MYSQL_APP_USER@'%';
|
|
EOF
|
|
|
|
for script in /db_migrations/*.sh; do
|
|
sh "$script" -h localhost -u root "-p$MYSQL_ROOT_PASSWORD" cacert
|
|
done
|