Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
squash! update provision file for mysql8
Browse files Browse the repository at this point in the history
  • Loading branch information
mumarkhan999 committed Sep 28, 2023
1 parent 39dedda commit b616f27
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions provision-mysql80.sql
Original file line number Diff line number Diff line change
@@ -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`;
Expand All @@ -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;

0 comments on commit b616f27

Please sign in to comment.