aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/db/db.conf3
-rw-r--r--config/db/db.sh9
2 files changed, 12 insertions, 0 deletions
diff --git a/config/db/db.conf b/config/db/db.conf
new file mode 100644
index 00000000..958f8bf0
--- /dev/null
+++ b/config/db/db.conf
@@ -0,0 +1,3 @@
+MYSQL_ROOT_PASSWORD=secret
+MYSQL_USER=policy_user
+MYSQL_PASSWORD=policy_user
diff --git a/config/db/db.sh b/config/db/db.sh
new file mode 100644
index 00000000..0de1deb1
--- /dev/null
+++ b/config/db/db.sh
@@ -0,0 +1,9 @@
+#!/bin/bash -xv
+
+for db in support onap_sdk log
+do
+ mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
+ mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
+done
+
+mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"