-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Román SG
committed
Jun 3, 2015
1 parent
4b9d881
commit e8c33d7
Showing
3 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
DIR=$(cd "$(dirname "$0")" && pwd) | ||
|
||
SCHEMA="$DIR/../share/schema.sql" | ||
|
||
MODACLOUDS_MYSQL_IP=${MODACLOUDS_MYSQL_IP:-127.0.0.1} | ||
MODACLOUDS_MYSQL_PORT=${MODACLOUDS_MYSQL_PORT:-3306} | ||
MODACLOUDS_MYSQL_DB=${MODACLOUDS_MYSQL_DB:-atossla} | ||
MODACLOUDS_MYSQL_USERNAME=${MODACLOUDS_MYSQL_USERNAME:-atossla} | ||
MODACLOUDS_MYSQL_PASSWORD=${MODACLOUDS_MYSQL_PASSWORD:-_atossla_} | ||
|
||
echo "Cleaning database: DB='$MODACLOUDS_MYSQL_DB' USER='$MODACLOUDS_MYSQL_USERNAME'" | ||
mysql --host="${MODACLOUDS_MYSQL_IP}" --port="${MODACLOUDS_MYSQL_PORT}" \ | ||
-p"${MODACLOUDS_MYSQL_PASSWORD}" -u "${MODACLOUDS_MYSQL_USERNAME}" "${MODACLOUDS_MYSQL_DB}" < "$SCHEMA" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Default database and user initialization | ||
CREATE DATABASE IF NOT EXISTS atossla; | ||
CREATE USER atossla@'%' IDENTIFIED BY '_atossla_'; | ||
CREATE USER atossla@'localhost' IDENTIFIED BY '_atossla_'; | ||
GRANT ALL PRIVILEGES ON atossla.* TO atossla@'%'; | ||
GRANT ALL PRIVILEGES ON atossla.* TO atossla@'localhost'; |