Skip to content

Commit

Permalink
Use the minimum privileges needed
Browse files Browse the repository at this point in the history
Fixes #291
  • Loading branch information
sahilm committed Jun 25, 2024
1 parent e0dd650 commit 268511c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions compose/bootstrap.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use mysql;

create role if not exists R_DO_IT_ALL;
grant all on *.* to R_DO_IT_ALL;
create role if not exists R_MIGRATOR;
grant alter, create, delete, drop, index, insert, lock tables, select, trigger, update on *.* to R_MIGRATOR;
create user if not exists msandbox@'%' identified with caching_sha2_password by 'msandbox';

grant R_DO_IT_ALL to msandbox@'%' ;
set default role R_DO_IT_ALL to msandbox@'%';

grant R_MIGRATOR to msandbox@'%' ;
set default role R_MIGRATOR to msandbox@'%';

create role if not exists R_REPLICATION;
grant REPLICATION SLAVE, REPLICATION CLIENT on *.* to R_REPLICATION;
Expand Down

0 comments on commit 268511c

Please sign in to comment.