-- $ Id: $

-- Convenience script for creating mysql-databse - users for use with Origo.
-- Note: if you create DB-users with this script, the passwords in /etc/aranea/aranea.conf must match the ones used here!

-- Change these passworts to custom ones!!!
SET @storage = '6pGn4GTj3phaCWfJ';
SET @manager = 'MHEx8VqRTnUbLEGE';

-- only edit stuff below this line if you're really sure what you're doing.

-- user 'storage_user' - full rights
CREATE USER 'origo_storage'@'localhost' IDENTIFIED BY '@storage';
GRANT USAGE ON * . * TO 'origo_storage'@'localhost' IDENTIFIED BY '@storage' 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 '@manager';
GRANT USAGE ON * . * TO 'origo_manager'@'localhost' IDENTIFIED BY '@manager' 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 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;
