Improvements to DB setup

Don't fail if the database or user already exists.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
changes/40/40/1
Zane Bitter 11 years ago
parent a03a307d33
commit 16986b4062

@ -199,11 +199,9 @@ echo "Verified connectivity to MySQL."
echo "Creating 'heat' database."
cat << EOF | mysql -u root ${MYSQL_ROOT_PW_ARG}
CREATE DATABASE heat;
CREATE USER 'heat'@'localhost' IDENTIFIED BY '${MYSQL_HEAT_PW}';
CREATE USER 'heat'@'%' IDENTIFIED BY '${MYSQL_HEAT_PW}';
GRANT ALL ON heat.* TO 'heat'@'localhost';
GRANT ALL ON heat.* TO 'heat'@'%';
CREATE DATABASE IF NOT EXISTS heat;
GRANT ALL ON heat.* TO 'heat'@'localhost' IDENTIFIED BY '${MYSQL_HEAT_PW}';
GRANT ALL ON heat.* TO 'heat'@'%' IDENTIFIED BY '${MYSQL_HEAT_PW}';
flush privileges;
EOF

Loading…
Cancel
Save