mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
65 lines
1.7 KiB
Text
65 lines
1.7 KiB
Text
connection node_1;
|
|
CREATE USER user1, user2 IDENTIFIED BY 'password';
|
|
connection node_2;
|
|
SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
|
|
COUNT(*) = 2
|
|
1
|
|
connection node_1;
|
|
ALTER USER user1 PASSWORD EXPIRE;
|
|
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
|
|
password_expired = 'Y'
|
|
1
|
|
connection node_2;
|
|
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
|
|
password_expired = 'Y'
|
|
1
|
|
connection node_1;
|
|
RENAME USER user2 TO user3;
|
|
connection node_2;
|
|
SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
|
|
COUNT(*) = 0
|
|
1
|
|
SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3';
|
|
COUNT(*) = 1
|
|
1
|
|
connection node_1;
|
|
SET PASSWORD FOR user3 = PASSWORD('foo');
|
|
connection node_1;
|
|
SELECT password != '' FROM mysql.user WHERE user = 'user3';
|
|
password != ''
|
|
1
|
|
connection node_1;
|
|
DROP USER user1, user3;
|
|
connection node_2;
|
|
SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2');
|
|
COUNT(*) = 0
|
|
1
|
|
connection node_1;
|
|
GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password';
|
|
connection node_2;
|
|
SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4';
|
|
COUNT(*) = 1
|
|
1
|
|
SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4';
|
|
Select_priv = 'Y'
|
|
1
|
|
connection node_1;
|
|
CREATE USER user5;
|
|
GRANT PROXY ON user4 TO user5;
|
|
connection node_2;
|
|
SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5';
|
|
COUNT(*) = 1
|
|
1
|
|
connection node_1;
|
|
REVOKE ALL PRIVILEGES ON *.* FROM user4;
|
|
connection node_2;
|
|
SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4';
|
|
Select_priv = 'N'
|
|
1
|
|
connection node_1;
|
|
REVOKE PROXY ON user4 FROM user5;
|
|
connection node_2;
|
|
SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5';
|
|
COUNT(*) = 0
|
|
1
|
|
DROP USER user4, user5;
|