From 4db5b311382e6ae59d1828ffcd6997f688373640 Mon Sep 17 00:00:00 2001 From: Ben Patterson Date: Thu, 13 Nov 2014 14:41:38 -0500 Subject: [PATCH] Don't use 'test' db for mysql since it's reserved. This db name is reserved and used by mysql installations. This can cause conflicts when trying to populate our own 'test' database on mysql. Conflicts: scripts/reset-test-db.sh --- cms/envs/bok_choy.auth.json | 2 +- lms/envs/bok_choy.auth.json | 2 +- scripts/reset-test-db.sh | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cms/envs/bok_choy.auth.json b/cms/envs/bok_choy.auth.json index 17b46a9b6c..e0b60afbd3 100644 --- a/cms/envs/bok_choy.auth.json +++ b/cms/envs/bok_choy.auth.json @@ -26,7 +26,7 @@ "default": { "ENGINE": "django.db.backends.mysql", "HOST": "localhost", - "NAME": "test", + "NAME": "edxtest", "PASSWORD": "", "PORT": "3306", "USER": "root" diff --git a/lms/envs/bok_choy.auth.json b/lms/envs/bok_choy.auth.json index 1d244c93e8..8504e8c276 100644 --- a/lms/envs/bok_choy.auth.json +++ b/lms/envs/bok_choy.auth.json @@ -26,7 +26,7 @@ "default": { "ENGINE": "django.db.backends.mysql", "HOST": "localhost", - "NAME": "test", + "NAME": "edxtest", "PASSWORD": "", "PORT": "3306", "USER": "root" diff --git a/scripts/reset-test-db.sh b/scripts/reset-test-db.sh index 42d8d69e8d..4b6634bc47 100755 --- a/scripts/reset-test-db.sh +++ b/scripts/reset-test-db.sh @@ -25,7 +25,7 @@ DB_CACHE_DIR="common/test/db_cache" # Ensure the test database exists. -echo "CREATE DATABASE IF NOT EXISTS test;" | mysql -u root +echo "CREATE DATABASE IF NOT EXISTS edxtest;" | mysql -u root # Clear out the test database ./manage.py lms --settings bok_choy reset_db --traceback --noinput @@ -34,7 +34,7 @@ echo "CREATE DATABASE IF NOT EXISTS test;" | mysql -u root if [[ -f $DB_CACHE_DIR/bok_choy_schema.sql && -f $DB_CACHE_DIR/bok_choy_data.json ]]; then # Load the schema, then the data (including the migration history) - mysql -u root test < $DB_CACHE_DIR/bok_choy_schema.sql + mysql -u root edxtest < $DB_CACHE_DIR/bok_choy_schema.sql ./manage.py lms --settings bok_choy loaddata $DB_CACHE_DIR/bok_choy_data.json # Re-run migrations to ensure we are up-to-date @@ -52,6 +52,6 @@ else # Dump the schema and data to the cache ./manage.py lms --settings bok_choy dumpdata > $DB_CACHE_DIR/bok_choy_data.json - mysqldump -u root --no-data --skip-comments --skip-dump-date test > $DB_CACHE_DIR/bok_choy_schema.sql + mysqldump -u root --no-data --skip-comments --skip-dump-date edxtest > $DB_CACHE_DIR/bok_choy_schema.sql fi