CREATE USER 'test1'@'localhost' identified BY 'test1';
DROP USER 'test2'@'localhost';
SHOW GRANTS FOR 'test1'@'localhost';
# 分配用户所有权限在for_end_test库的test1表
GRANT ALL PRIVILEGES ON for_end_test.test1 TO 'test1'@'localhost';
# 分配用户可查询权限在for_end_test库的test1表
GRANT SELECT ON for_end_test.test1 TO 'test1'@'localhost';
# 收回用户可查询权限在for_end_test库的test1表
REVOKE SELECT ON for_end_test.test1 FROM 'test1'@'localhost';
FLUSH PRIVILEGES;