Skip to content

Commit

Permalink
Add roles and grants for MaxScale
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlLevik committed Nov 1, 2024
1 parent 6e8831f commit 6a760c3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions grants/maxscale.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE ROLE IF NOT EXISTS maxscale_role;
CREATE ROLE IF NOT EXISTS maxmon_role;

-- You must also create database users and grant these roles to them, e.g.
-- CREATE USER maxscale_user@'%' IDENTIFIED BY 'the_password';
-- CREATE USER maxmon_user@'%' IDENTIFIED BY 'the_password';
-- GRANT maxscale_role to maxscale_user@'%';
-- GRANT maxmon_role to maxmon_user@'%';
-- SET DEFAULT ROLE maxscale_role FOR maxscale_user@'%';
-- SET DEFAULT ROLE maxmon_role FOR maxmon_user@'%';

GRANT SHOW DATABASES ON *.* TO maxscale_role;
GRANT SELECT ON mysql.procs_priv TO maxscale_role;
GRANT SELECT ON mysql.tables_priv TO maxscale_role;
GRANT SELECT ON mysql.db TO maxscale_role;
GRANT SELECT ON mysql.roles_mapping TO maxscale_role;
GRANT SELECT ON mysql.columns_priv TO maxscale_role;
GRANT SELECT ON mysql.proxies_priv TO maxscale_role;
GRANT SELECT ON mysql.user TO maxscale_role;

GRANT REPLICATION SLAVE, BINLOG MONITOR, SLAVE MONITOR ON *.* TO maxmon_role;
GRANT SELECT ON mysql.user TO maxmon_role;

0 comments on commit 6a760c3

Please sign in to comment.