mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
108 lines
4.8 KiB
Text
108 lines
4.8 KiB
Text
SHOW GRANTS FOR root@invalid_host;
|
|
ERROR 42000: There is no such grant defined for user 'root' on host 'invalid_host'
|
|
create user test;
|
|
create user foo;
|
|
create role foo;
|
|
grant foo to test;
|
|
connect conn_1, localhost, test,,;
|
|
set role foo;
|
|
show grants for test;
|
|
Grants for test@%
|
|
GRANT foo TO 'test'@'%'
|
|
GRANT USAGE ON *.* TO 'test'@'%'
|
|
show grants for foo;
|
|
Grants for foo
|
|
GRANT USAGE ON *.* TO 'foo'
|
|
show grants for foo@'%';
|
|
ERROR 42000: Access denied for user 'test'@'%' to database 'mysql'
|
|
connection default;
|
|
drop user test, foo;
|
|
drop role foo;
|
|
CREATE TABLE t1 (a INT);
|
|
LOCK TABLE t1 WRITE;
|
|
REVOKE EXECUTE ON PROCEDURE sp FROM u;
|
|
ERROR HY000: Table 'procs_priv' was not locked with LOCK TABLES
|
|
REVOKE PROCESS ON *.* FROM u;
|
|
ERROR HY000: Table 'db' was not locked with LOCK TABLES
|
|
DROP TABLE t1;
|
|
create user u1@h identified with 'mysql_native_password' using 'pwd';
|
|
ERROR HY000: Password hash should be a 41-digit hexadecimal number
|
|
create user u1@h identified with 'mysql_native_password' using password('pwd');
|
|
create user u2@h identified with 'mysql_native_password' using '*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD';
|
|
create user u3@h identified with 'mysql_native_password';
|
|
set password for u3@h = 'pwd';
|
|
ERROR HY000: Password hash should be a 41-digit hexadecimal number
|
|
set password for u3@h = password('pwd');
|
|
create user u4@h identified with 'mysql_native_password';
|
|
set password for u4@h = '*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD';
|
|
create user u5@h identified with 'mysql_old_password' using 'pwd';
|
|
ERROR HY000: Password hash should be a 16-digit hexadecimal number
|
|
create user u5@h identified with 'mysql_old_password' using password('pwd');
|
|
create user u6@h identified with 'mysql_old_password' using '78a302dd267f6044';
|
|
create user u7@h identified with 'mysql_old_password';
|
|
set password for u7@h = 'pwd';
|
|
ERROR HY000: Password hash should be a 41-digit hexadecimal number
|
|
set password for u7@h = old_password('pwd');
|
|
create user u8@h identified with 'mysql_old_password';
|
|
set password for u8@h = '78a302dd267f6044';
|
|
select user,host,plugin,authentication_string from mysql.user where host='h';
|
|
User Host plugin authentication_string
|
|
u1 h mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD
|
|
u2 h mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD
|
|
u3 h mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD
|
|
u4 h mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD
|
|
u5 h mysql_old_password 78a302dd267f6044
|
|
u6 h mysql_old_password 78a302dd267f6044
|
|
u7 h mysql_old_password 78a302dd267f6044
|
|
u8 h mysql_old_password 78a302dd267f6044
|
|
update mysql.global_priv set priv=json_set(priv, '$.authentication_string', 'bad') where user='u1';
|
|
update mysql.global_priv set priv=json_set(priv, '$.authentication_string', 'bad') where user='u5';
|
|
update mysql.global_priv set priv=json_set(priv, '$.plugin', 'nonexistent') where user='u8';
|
|
flush privileges;
|
|
Warnings:
|
|
Error 1372 Password hash should be a 41-digit hexadecimal number
|
|
Error 1372 Password hash should be a 16-digit hexadecimal number
|
|
Warning 1524 Plugin 'nonexistent' is not loaded
|
|
show create user u1@h;
|
|
ERROR 28000: Can't find any matching row in the user table
|
|
show create user u2@h;
|
|
CREATE USER for u2@h
|
|
CREATE USER 'u2'@'h' IDENTIFIED BY PASSWORD '*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD'
|
|
show create user u3@h;
|
|
CREATE USER for u3@h
|
|
CREATE USER 'u3'@'h' IDENTIFIED BY PASSWORD '*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD'
|
|
show create user u4@h;
|
|
CREATE USER for u4@h
|
|
CREATE USER 'u4'@'h' IDENTIFIED BY PASSWORD '*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD'
|
|
show create user u5@h;
|
|
ERROR 28000: Can't find any matching row in the user table
|
|
show create user u6@h;
|
|
CREATE USER for u6@h
|
|
CREATE USER 'u6'@'h' IDENTIFIED BY PASSWORD '78a302dd267f6044'
|
|
show create user u7@h;
|
|
CREATE USER for u7@h
|
|
CREATE USER 'u7'@'h' IDENTIFIED BY PASSWORD '78a302dd267f6044'
|
|
show create user u8@h;
|
|
ERROR 28000: Can't find any matching row in the user table
|
|
grant select on *.* to u1@h;
|
|
ERROR 28000: Can't find any matching row in the user table
|
|
grant select on *.* to u2@h;
|
|
grant select on *.* to u3@h;
|
|
grant select on *.* to u4@h;
|
|
grant select on *.* to u5@h;
|
|
ERROR 28000: Can't find any matching row in the user table
|
|
grant select on *.* to u6@h;
|
|
grant select on *.* to u7@h;
|
|
grant select on *.* to u8@h;
|
|
ERROR 28000: Can't find any matching row in the user table
|
|
select user,select_priv,plugin,authentication_string from mysql.user where user like 'u_';
|
|
User Select_priv plugin authentication_string
|
|
u1 N mysql_native_password bad
|
|
u2 Y mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD
|
|
u3 Y mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD
|
|
u4 Y mysql_native_password *975B2CD4FF9AE554FE8AD33168FBFC326D2021DD
|
|
u5 N mysql_old_password bad
|
|
u6 Y mysql_old_password 78a302dd267f6044
|
|
u7 Y mysql_old_password 78a302dd267f6044
|
|
u8 N nonexistent 78a302dd267f6044
|
|
drop user u1@h, u2@h, u3@h, u4@h, u5@h, u6@h, u7@h, u8@h;
|