---
slug: /delete-a-user
---

# 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](../200.user-and-permission/400.view-user-permissions.md). If not, contact the administrator to grant the privilege. For more information, see [Grant privileges directly](200.direct-authority.md).

## 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:

   ```sql
   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:

   ```shell
   DROP USER sqluser02;
   ```

   ```shell
   Query OK, 0 rows affected
   ```

## References

For more information about the `DROP USER` statement, see [DROP USER](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000002017002).