Purpose
You can use this statement to drop one or more database users.
Notice
- To execute this statement, you must have the global
CREATE USERprivilege. - To drop a user in the
mysql.usertable, you must execute theDROPstatement instead of theDELETEstatement. - After you drop a user, all its privileges are dropped along with it.
Syntax
DROP USER user_name [, user_name...];
Parameters
| Parameter | Description |
|---|---|
| user_name | The username. Multiple usernames must be separated with commas (,). |
Examples
Drop a user named sqluser01.
obclient> DROP USER sqluser01;
Query OK, 0 rows affected