cleanup sql grants for test dbs.
@@ -10,6 +10,7 @@ fi
${mysql_cmd} <<EOF
CREATE DATABASE IF NOT EXISTS ${DJANGO_DB_NAME};
CREATE DATABASE IF NOT EXISTS test_${DJANGO_DB_NAME};
-GRANT ALL PRIVILEGES on ${DJANGO_DB_NAME}.* to ${DJANGO_DB_USER}@'%' IDENTIFIED BY '${DJANGO_DB_PASSWORD}';
-GRANT ALL PRIVILEGES on test_${DJANGO_DB_NAME}.* to ${DJANGO_DB_USER}@'%' IDENTIFIED BY '${DJANGO_DB_PASSWORD}';
+GRANT ALL PRIVILEGES on `${DJANGO_DB_NAME}`.* to ${DJANGO_DB_USER}@'%' IDENTIFIED BY '${DJANGO_DB_PASSWORD}';
+GRANT ALL PRIVILEGES on `test\_${DJANGO_DB_NAME}`.* to ${DJANGO_DB_USER}@'%' IDENTIFIED BY '${DJANGO_DB_PASSWORD}';
+GRANT ALL PRIVILEGES on `test\_${DJANGO_DB_NAME}\_%`.* to ${DJANGO_DB_USER}@'%' IDENTIFIED BY '${DJANGO_DB_PASSWORD}';
EOF
