From b616f276c93e9f456bb74a4623121e129c7a946b Mon Sep 17 00:00:00 2001 From: Muhammad Umar Khan Date: Thu, 28 Sep 2023 20:40:10 +0500 Subject: [PATCH] squash! update provision file for mysql8 --- provision-mysql80.sql | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/provision-mysql80.sql b/provision-mysql80.sql index 19b32e0ebdd..d27baedd605 100644 --- a/provision-mysql80.sql +++ b/provision-mysql80.sql @@ -1,33 +1,43 @@ --- 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 IF NOT EXISTS 'credentials001'@'%' IDENTIFIED BY 'password'; +DROP USER IF EXISTS 'credentials001'@'%'; +CREATE USER 'credentials001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON credentials.* TO 'credentials001'@'%'; CREATE DATABASE IF NOT EXISTS discovery; -CREATE USER IF NOT EXISTS 'discov001'@'%' IDENTIFIED BY 'password'; +DROP USER IF EXISTS 'discov001'@'%'; +CREATE USER 'discov001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON discovery.* TO 'discov001'@'%'; CREATE DATABASE IF NOT EXISTS ecommerce; -CREATE USER IF NOT EXISTS 'ecomm001'@'%' IDENTIFIED BY 'password'; +DROP USER IF EXISTS 'ecomm001'@'%'; +CREATE USER 'ecomm001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON ecommerce.* TO 'ecomm001'@'%'; CREATE DATABASE IF NOT EXISTS notes; -CREATE USER IF NOT EXISTS 'notes001'@'%' IDENTIFIED BY 'password'; +DROP USER IF EXISTS 'notes001'@'%'; +CREATE USER 'notes001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON notes.* TO 'notes001'@'%'; CREATE DATABASE IF NOT EXISTS registrar; -CREATE USER IF NOT EXISTS 'registrar001'@'%' IDENTIFIED BY 'password'; +DROP USER IF EXISTS 'registrar001'@'%'; +CREATE USER 'registrar001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON registrar.* TO 'registrar001'@'%'; CREATE DATABASE IF NOT EXISTS xqueue; -CREATE USER IF NOT EXISTS 'xqueue001'@'%' IDENTIFIED BY 'password'; +DROP USER IF EXISTS 'xqueue001'@'%'; +CREATE USER 'xqueue001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON xqueue.* TO 'xqueue001'@'%'; +CREATE DATABASE IF NOT EXISTS edxapp; +CREATE DATABASE IF NOT EXISTS edxapp_csmh; +DROP USER IF EXISTS 'edxapp001'@'%'; +CREATE USER 'edxapp001'@'%' IDENTIFIED BY 'password'; +GRANT ALL ON edxapp.* TO 'edxapp001'@'%'; +GRANT ALL ON edxapp_csmh.* TO 'edxapp001'@'%'; + CREATE DATABASE IF NOT EXISTS `dashboard`; -CREATE USER IF NOT EXISTS 'analytics001'@'%' IDENTIFIED BY 'password'; +DROP USER IF EXISTS 'analytics001'@'%'; +CREATE USER 'analytics001'@'%' IDENTIFIED BY 'password'; GRANT ALL ON `dashboard`.* TO 'analytics001'@'%'; CREATE DATABASE IF NOT EXISTS `analytics-api`; @@ -39,10 +49,5 @@ GRANT ALL ON `reports`.* TO 'analytics001'@'%'; CREATE DATABASE IF NOT EXISTS `reports_v1`; GRANT ALL ON `reports_v1`.* TO 'analytics001'@'%'; -CREATE DATABASE IF NOT EXISTS edxapp; -CREATE DATABASE IF NOT EXISTS edxapp_csmh; -CREATE USER IF NOT EXISTS 'edxapp001'@'%' IDENTIFIED BY 'password'; -GRANT ALL ON edxapp.* TO 'edxapp001'@'%'; -GRANT ALL ON edxapp_csmh.* TO 'edxapp001'@'%'; FLUSH PRIVILEGES;