DROP USER IF EXISTS 'app_service'@'%';

CREATE USER 'app_service'@'%' IDENTIFIED BY 'Password123';

-- Can grant table permission depend on usage
GRANT USAGE ON *.* TO 'app_service'@'%';
GRANT EXECUTE ON `sample_database`.* TO 'app_service'@'%';
GRANT SELECT, UPDATE ON `sample_database`.`table1` TO 'app_service'@'%';
GRANT SELECT, INSERT, UPDATE ON `sample_database`.`table2` TO 'app_service'@'%';