1bd3dd8c9b
We don't need an additional step to recreate tables. After all, an empty database with no tables is useless. Change-Id: Ic1b4a8ceffa61e1600b661bd0eaa10431962e44b
16 lines
478 B
Bash
Executable File
16 lines
478 B
Bash
Executable File
#!/bin/bash
|
|
|
|
MYSQL_ROOT_PW=${MYSQL_ROOT_PW:-openstack}
|
|
MYSQL_SENLIN_PW=${MYSQL_SENLIN_PW:-openstack}
|
|
|
|
echo "Recreating 'senlin' database."
|
|
cat << EOF | mysql -u root --password=${MYSQL_ROOT_PW}
|
|
DROP DATABASE IF EXISTS senlin;
|
|
CREATE DATABASE senlin DEFAULT CHARACTER SET utf8;
|
|
GRANT ALL ON senlin.* TO 'senlin'@'localhost' IDENTIFIED BY '${MYSQL_SENLIN_PW}';
|
|
GRANT ALL ON senlin.* TO 'senlin'@'%' IDENTIFIED BY '${MYSQL_SENLIN_PW}';
|
|
flush privileges;
|
|
EOF
|
|
|
|
senlin-manage db_sync
|