DROP USER
DROP USER 'idontexist';
ERROR 1396 (HY000): Operation DROP USER failed for idontexist@%
DROP USER IF EXISTS 'idontexist';
Query OK, 0 rows affected (0.01 sec)
CREATE USER 'newuser' IDENTIFIED BY 'mypassword';
GRANT ALL ON test.* TO 'newuser';
+-------------------------------------------------+
| Grants for newuser@% |
+-------------------------------------------------+
| GRANT USAGE ON *.* TO 'newuser'@'%' |
| GRANT ALL PRIVILEGES ON test.* TO 'newuser'@'%' |
+-------------------------------------------------+
2 rows in set (0.00 sec)
REVOKE ALL ON test.* FROM 'newuser';
+-------------------------------------+
| Grants for newuser@% |
| GRANT USAGE ON *.* TO 'newuser'@'%' |
+-------------------------------------+
1 row in set (0.00 sec)
DROP USER 'newuser';
Query OK, 0 rows affected (0.14 sec)
SHOW GRANTS FOR 'newuser';
- 在 TiDB 中删除不存在的用户时,使用 可避免出现警告。