Skip to main content

Delete a user

You can execute the DROP USER statement to delete a user that is no longer needed.

Prerequisites

The current user must have the CREATE USER privilege at the global level to successfully execute the DROP USER statement. To check whether the current user has this privilege, see View user privileges. If not, contact the administrator to grant the privilege. For more information, see Grant privileges directly.

Limitations

You cannot manage privileges by using the DELETE statement on the mysql.user table.

Procedure

  1. Log in to seekdb.

  2. Execute the following statement to delete one or more users.

    The statement is as follows:

    DROP USER user_name [, user_name...];

    In the statement, user_name specifies the username of the user to be deleted. If you want to delete multiple users, separate the usernames with commas (,).

    After a user is deleted, the databases and objects created by the user are retained, but all privileges of the user are revoked.

    Here is an example of deleting the sqluser02 user:

    DROP USER sqluser02;
    Query OK, 0 rows affected

References

For more information about the DROP USER statement, see DROP USER.