-- drop the users
DROP USER IF EXISTS samantha@localhost;
DROP USER IF EXISTS tealc;
DROP USER IF EXISTS daniel;
DROP USER IF EXISTS jack;
-- create the users
CREATE USER samantha IDENTIFIED BY 'narimtollan';
CREATE USER tealc IDENTIFIED BY 'ishtahakty';
CREATE USER daniel IDENTIFIED BY 'shareabydos';
CREATE USER jack@localhost IDENTIFIED BY 'samtauri';
-- grant privileges to the brains of the operation (samantha)
GRANT ALL ON *.* TO samantha@localhost WITH GRANT OPTION;
-- grant privileges to the sg1 manager (jack)
GRANT SELECT, INSERT, UPDATE, DELETE ON sg1.* TO jack WITH GRANT OPTION;
-- grant privileges to sg1 users (tealc, daniel)
GRANT SELECT, INSERT, UPDATE, DELETE ON sg1.allies TO tealc, daniel;
GRANT SELECT, INSERT, UPDATE, DELETE ON sg1.enemies TO tealc, daniel;
GRANT SELECT, INSERT, UPDATE, DELETE ON sg1.neutral TO tealc, daniel;
GRANT SELECT ON sg1.treaties TO tealc, daniel;
GRANT SELECT ON sg1.ships TO tealc, daniel;