diff --git a/Makefile b/Makefile index b2d826ff97..ab342031f2 100644 --- a/Makefile +++ b/Makefile @@ -496,7 +496,8 @@ dev.reset: dev.remove-containers dev.reset-repos dev.prune dev.pull.large-and-sl dev.destroy.coursegraph: dev.remove-containers.coursegraph ## Remove all coursegraph data. docker volume rm ${COMPOSE_PROJECT_NAME}_coursegraph_data -dev.destroy: ## Irreversibly remove all devstack-related containers, networks, and volumes. +# See https://github.com/openedx/devstack/issues/1113 for lack of ability to destroy data volumes +dev.destroy: ## Irreversibly remove all devstack-related containers and networks (though not data volumes) $(WINPTY) bash ./destroy.sh ######################################################################################## diff --git a/drop-mysql-user.sql b/drop-mysql-user.sql deleted file mode 100644 index 0d5e52ca0f..0000000000 --- a/drop-mysql-user.sql +++ /dev/null @@ -1,11 +0,0 @@ -#docker-compose exec -T mysql80 bash -e -c "mysql -uroot mysql" < drop-mysql-user.sql -#docker exec -it edx.devstack.mysql80 mysql - -drop user 'credentials001'@'%'; -drop user 'discov001'@'%'; -drop user 'ecomm001'@'%'; -drop user 'notes001'@'%'; -drop user 'registrar001'@'%'; -drop user 'xqueue001'@'%'; -drop user 'analytics001'@'%'; -drop user 'edxapp001'@'%'; diff --git a/provision-mysql80.sql b/provision-mysql80.sql index cdcd48920b..19b32e0ebd 100644 --- a/provision-mysql80.sql +++ b/provision-mysql80.sql @@ -1,29 +1,33 @@ +-- The use of `CREATE USER IF NOT EXISTS` is necessary since the +-- mysql80_data volume may already contain these users due to previous +-- provisioning https://github.com/openedx/devstack/issues/1113 + CREATE DATABASE IF NOT EXISTS credentials; -CREATE USER 'credentials001'@'%' IDENTIFIED BY 'password'; +CREATE USER IF NOT EXISTS 'credentials001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON credentials.* TO 'credentials001'@'%'; CREATE DATABASE IF NOT EXISTS discovery; -CREATE USER 'discov001'@'%' IDENTIFIED BY 'password'; +CREATE USER IF NOT EXISTS 'discov001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON discovery.* TO 'discov001'@'%'; CREATE DATABASE IF NOT EXISTS ecommerce; -CREATE USER 'ecomm001'@'%' IDENTIFIED BY 'password'; +CREATE USER IF NOT EXISTS 'ecomm001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON ecommerce.* TO 'ecomm001'@'%'; CREATE DATABASE IF NOT EXISTS notes; -CREATE USER 'notes001'@'%' IDENTIFIED BY 'password'; +CREATE USER IF NOT EXISTS 'notes001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON notes.* TO 'notes001'@'%'; CREATE DATABASE IF NOT EXISTS registrar; -CREATE USER 'registrar001'@'%' IDENTIFIED BY 'password'; +CREATE USER IF NOT EXISTS 'registrar001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON registrar.* TO 'registrar001'@'%'; CREATE DATABASE IF NOT EXISTS xqueue; -CREATE USER 'xqueue001'@'%' IDENTIFIED BY 'password'; +CREATE USER IF NOT EXISTS 'xqueue001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON xqueue.* TO 'xqueue001'@'%'; CREATE DATABASE IF NOT EXISTS `dashboard`; -CREATE USER 'analytics001'@'%' IDENTIFIED BY 'password'; +CREATE USER IF NOT EXISTS 'analytics001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON `dashboard`.* TO 'analytics001'@'%'; CREATE DATABASE IF NOT EXISTS `analytics-api`; @@ -37,7 +41,7 @@ GRANT ALL ON `reports_v1`.* TO 'analytics001'@'%'; CREATE DATABASE IF NOT EXISTS edxapp; CREATE DATABASE IF NOT EXISTS edxapp_csmh; -CREATE USER 'edxapp001'@'%' IDENTIFIED BY 'password'; +CREATE USER IF NOT EXISTS 'edxapp001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON edxapp.* TO 'edxapp001'@'%'; GRANT ALL ON edxapp_csmh.* TO 'edxapp001'@'%';