CREATE DATABASE IF NOT EXISTS account;
CREATE DATABASE IF NOT EXISTS common;
CREATE DATABASE IF NOT EXISTS log;
CREATE DATABASE IF NOT EXISTS player;
CREATE DATABASE IF NOT EXISTS hotbackup;

CREATE USER IF NOT EXISTS 'mt2'@'localhost' IDENTIFIED BY 'mt2@pw';

GRANT SELECT, INSERT, UPDATE, DELETE ON `account`.* TO 'mt2'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON `common`.* TO 'mt2'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON `log`.* TO 'mt2'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON `player`.* TO 'mt2'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON `hotbackup`.* TO 'mt2'@'localhost';

FLUSH PRIVILEGES;