645d093c45
Related: #84 Signed-off-by: Zane Bitter <zbitter@redhat.com>
27 lines
455 B
Bash
Executable File
27 lines
455 B
Bash
Executable File
#!/bin/bash
|
|
|
|
DATABASE=heat
|
|
|
|
while [ $# -gt 0 ]; do
|
|
case $1 in
|
|
heat|nova|keystone|glance)
|
|
DATABASE=$1
|
|
;;
|
|
-r|--rootpw)
|
|
shift
|
|
MYSQL_ROOT_PW_ARG="--password=$1"
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
cat << EOF | mysql -u root ${MYSQL_ROOT_PW_ARG}
|
|
DROP USER '${DATABASE}'@'localhost';
|
|
DROP USER '${DATABASE}'@'%';
|
|
DROP DATABASE ${DATABASE};
|
|
flush privileges;
|
|
EOF
|
|
|