-- Create databases
CREATE DATABASE IF NOT EXISTS sr_master;
CREATE DATABASE IF NOT EXISTS sr_company_25;
CREATE DATABASE IF NOT EXISTS sr_company_64;
CREATE DATABASE IF NOT EXISTS sr_core;
CREATE DATABASE IF NOT EXISTS sr_core_sync;
CREATE DATABASE IF NOT EXISTS sr_session;



-- Grant privileges
GRANT ALL PRIVILEGES ON sr_master.* TO 'sr_mysql_user'@'%';
GRANT ALL PRIVILEGES ON sr_company_25.* TO 'sr_mysql_user'@'%';
GRANT ALL PRIVILEGES ON sr_company_64.* TO 'sr_mysql_user'@'%';
GRANT ALL PRIVILEGES ON sr_core.* TO 'sr_mysql_user'@'%';
GRANT ALL PRIVILEGES ON sr_core_sync.* TO 'sr_mysql_user'@'%';
GRANT ALL PRIVILEGES ON sr_session.* TO 'sr_mysql_user'@'%';

FLUSH PRIVILEGES;
