mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Change the default authentication for root@localhost to IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket which provides secure passwordless login, while still allowing SET PASSWORD to work as expected. Also create a second all-privilege account for the user that owns datadir (and thus has full access to the data anyway). Compile unix_socket plugin statically into the server.
63 lines
1.3 KiB
Plaintext
63 lines
1.3 KiB
Plaintext
--source include/not_embedded.inc
|
|
create user foo;
|
|
create role role1;
|
|
create role role2;
|
|
create role role3;
|
|
|
|
grant role1 to foo;
|
|
grant role2 to role1;
|
|
grant role3 to foo;
|
|
|
|
|
|
connect (foo, localhost, foo);
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
set default role role3;
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
set default role role1;
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
|
|
disconnect foo;
|
|
connection default;
|
|
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
set default role none for foo;
|
|
connect (foo, localhost, foo);
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
disconnect foo;
|
|
connection default;
|
|
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
set default role role1;
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
set default role role2;
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
set default role role3;
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
set default role none;
|
|
--sorted_result
|
|
select * from information_schema.applicable_roles;
|
|
|
|
drop role role3;
|
|
drop role role2;
|
|
drop role role1;
|
|
drop user foo;
|
|
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.default_role'));
|