Skip to content

Commit 6a760c3

Browse files
committed
Add roles and grants for MaxScale
1 parent 6e8831f commit 6a760c3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

grants/maxscale.sql

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CREATE ROLE IF NOT EXISTS maxscale_role;
2+
CREATE ROLE IF NOT EXISTS maxmon_role;
3+
4+
-- You must also create database users and grant these roles to them, e.g.
5+
-- CREATE USER maxscale_user@'%' IDENTIFIED BY 'the_password';
6+
-- CREATE USER maxmon_user@'%' IDENTIFIED BY 'the_password';
7+
-- GRANT maxscale_role to maxscale_user@'%';
8+
-- GRANT maxmon_role to maxmon_user@'%';
9+
-- SET DEFAULT ROLE maxscale_role FOR maxscale_user@'%';
10+
-- SET DEFAULT ROLE maxmon_role FOR maxmon_user@'%';
11+
12+
GRANT SHOW DATABASES ON *.* TO maxscale_role;
13+
GRANT SELECT ON mysql.procs_priv TO maxscale_role;
14+
GRANT SELECT ON mysql.tables_priv TO maxscale_role;
15+
GRANT SELECT ON mysql.db TO maxscale_role;
16+
GRANT SELECT ON mysql.roles_mapping TO maxscale_role;
17+
GRANT SELECT ON mysql.columns_priv TO maxscale_role;
18+
GRANT SELECT ON mysql.proxies_priv TO maxscale_role;
19+
GRANT SELECT ON mysql.user TO maxscale_role;
20+
21+
GRANT REPLICATION SLAVE, BINLOG MONITOR, SLAVE MONITOR ON *.* TO maxmon_role;
22+
GRANT SELECT ON mysql.user TO maxmon_role;

0 commit comments

Comments
 (0)