2013-10-18 09:26:02 -07:00
|
|
|
create role r1;
|
|
|
|
grant r1 to root@localhost;
|
|
|
|
create user u1;
|
|
|
|
set role r1;
|
|
|
|
grant r1 to u1;
|
|
|
|
select * from mysql.roles_mapping;
|
2013-10-18 12:21:10 -07:00
|
|
|
Host User Role Admin_option
|
|
|
|
% u1 r1 N
|
2013-10-18 12:27:07 -07:00
|
|
|
localhost root r1 Y
|
2013-10-18 09:26:02 -07:00
|
|
|
drop user u1;
|
|
|
|
select * from mysql.roles_mapping;
|
2013-10-18 12:21:10 -07:00
|
|
|
Host User Role Admin_option
|
2013-10-18 12:27:07 -07:00
|
|
|
localhost root r1 Y
|
2013-10-18 09:26:02 -07:00
|
|
|
show grants;
|
|
|
|
Grants for root@localhost
|
|
|
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
2013-10-18 11:38:13 -07:00
|
|
|
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
|
2013-10-18 09:26:02 -07:00
|
|
|
GRANT USAGE ON *.* TO 'r1'
|
2013-10-18 12:27:07 -07:00
|
|
|
GRANT r1 TO 'root'@'localhost' WITH ADMIN OPTION
|
2013-10-18 09:26:02 -07:00
|
|
|
drop role r1;
|
|
|
|
select * from mysql.roles_mapping;
|
2013-10-18 12:21:10 -07:00
|
|
|
Host User Role Admin_option
|
2013-10-18 09:26:02 -07:00
|
|
|
show grants;
|
|
|
|
Grants for root@localhost
|
|
|
|
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
2013-10-18 11:38:13 -07:00
|
|
|
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
|