-- readonly user 'origo_snmp'
CREATE USER 'origo_snmp'@'localhost' IDENTIFIED BY 'uYH8xrxELMS9GRP2';
GRANT USAGE ON * . * TO 'origo_snmp'@'localhost' IDENTIFIED BY 'uYH8xrxELMS9GRP2' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
  -- grant readonly rights on origo-DB
GRANT SELECT ON `origo` . * TO 'origo_snmp'@'localhost';

-- user 'storage_user' - full rights
CREATE USER 'origo_storage'@'localhost' IDENTIFIED BY '6pGn4GTj3phaCWfJ';
GRANT USAGE ON * . * TO 'origo_storage'@'localhost' IDENTIFIED BY '6pGn4GTj3phaCWfJ' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
-- grant full rights on origo-DB
GRANT ALL PRIVILEGES ON `origo` . * TO 'origo_storage'@'localhost' WITH GRANT OPTION ;

-- user 'manager_user' - full rights
CREATE USER 'origo_manager'@'localhost' IDENTIFIED BY 'MHEx8VqRTnUbLEGE';
GRANT USAGE ON * . * TO 'origo_manager'@'localhost' IDENTIFIED BY 'MHEx8VqRTnUbLEGE' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
-- grant full rights on origo-DB
GRANT ALL PRIVILEGES ON * . * TO 'origo_manager'@'localhost' WITH GRANT OPTION ;

-- user 'db_crawler' - full rights
CREATE USER 'origo_db_crawler'@'localhost' IDENTIFIED BY 'UnqrryVvsGYnHfA3';
GRANT USAGE ON * . * TO 'origo_db_crawler'@'localhost' IDENTIFIED BY 'UnqrryVvsGYnHfA3' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
-- grant full rights on origo-DB
GRANT ALL PRIVILEGES ON `origo` . * TO 'origo_db_crawler'@'localhost' WITH GRANT OPTION ;

-- user 'drupal_cron' - full rights
CREATE USER 'origo_drupalcron'@'localhost' IDENTIFIED BY 'vKTxzaqfWADscEnx';
GRANT USAGE ON * . * TO 'origo_drupalcron'@'localhost' IDENTIFIED BY 'vKTxzaqfWADscEnx' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
-- grant full rights on origo-DB
GRANT ALL PRIVILEGES ON `origo` . * TO 'origo_drupalcron'@'localhost' WITH GRANT OPTION ;

-- user 'origo_data_mgmt' - full rights
CREATE USER 'origo_data_mgmt'@'localhost' IDENTIFIED BY '3LeFtCScS6GaHasS';
GRANT USAGE ON * . * TO 'origo_data_mgmt'@'localhost' IDENTIFIED BY '3LeFtCScS6GaHasS' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
-- grant full rights on origo-DB
GRANT ALL PRIVILEGES ON `origo` . * TO 'origo_data_mgmt'@'localhost' WITH GRANT OPTION ;


-- User used for running unittests\
-- NOTE: do not change its password
CREATE USER 'origo_test'@'localhost' IDENTIFIED BY 'origo';
GRANT USAGE ON * . * TO 'origo_test'@'localhost' IDENTIFIED BY 'origo' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
GRANT ALL PRIVILEGES ON `origo\_test` . * TO 'origo_test'@'localhost' WITH GRANT OPTION ;

FLUSH PRIVILEGES;
