授权可以同时写多个角色和多个用户吗?
我认为:开发人员需要所有权限,所以没必要通过角色授权,直接授予所有权限即可.
create user 'dev01' @ 'appdb' indentified by '123456';
create user 'dev02' @ 'appdb' indentified by '123456';
create user 'dev03' @ 'appdb' indentified by '123456';
grant all privileges on appdb.* to 'dev01';
grant all privileges on appdb.* to 'dev02';
grant all privileges on appdb.* to 'dev03';
然后再创建两个角色,一个只读权限,一个读写权限。
create role 'read_role';
grant select on appdb.* to 'read_role';
create role 'write_role';
grant insert,update,delete,select on appdb.* to 'write_role';
grant 'read_role' to 'read01';
grant 'read_role' to 'read02';
grant 'write_role' to 'write01';
grant 'write_role' to 'write02';
请问:授权可以同时写多个角色和多个用户吗?比如这么写:
grant 'read_role','write_role' to 'dev01';
grant 'read_role','write_role' to 'dev01',dev02;
grant 'write_role' to 'write01','write02';