OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V3.2.4Enterprise Edition

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V3.2.4
    iconOceanBase Database
    SQL - V 3.2.4Enterprise Edition
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Drop a user

    Last Updated:2023-10-27 09:57:43  Updated
    share
    What is on this page
    Drop a user by using an SQL statement
    Drop a user in the OCP console
    Prerequisites
    Procedure

    folded

    share

    You can drop a user that is no longer in use by using the DROP USER statement or in the OceanBase Cloud Platform (OCP) console.

    Drop a user by using an SQL statement

    You can use the DROP USER statement to drop one or more OceanBase Database users.

    The syntax is as follows:

    DROP USER user_name [, user_name...];
    

    Some notes about this:

    • To execute the DROP USER statement, you must have the global CREATE USER privilege.

      For more information about how to view your privileges, see View user privileges. If you do not have the required privilege, contact the administrator. For more information, see Modify user privileges.

    • You cannot use the DELETE statement to delete user privileges from the mysql.user table.

    • After you drop a user, the database objects created by the user are not dropped. However, all privileges of the user are dropped.

    • When you drop multiple users at a time, separate the usernames with commas (,).

    The following sample statement shows how to drop the sqluser02 user:

    obclient> DROP USER sqluser02;
    Query OK, 0 rows affected
    

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

    Drop a user in the OCP console

    Prerequisites

    Before you drop a user, ensure that:

    • The TENANT_MANAGER role is assigned to you. Otherwise, request the OceanBase Cloud Platform (OCP) administrator to assign the role. For more information, see "Edit a user" in the OCP User Guide of the corresponding version.

    • Your password box contains the root or sys password of the tenant. For more information about the password box, see the OCP User Guide of the corresponding version.

    Procedure

    1. Log on to the OCP console.

    2. In the left-side navigation pane, click Tenants to go to the Tenants page.

    3. In the tenant list, find the target tenant to which the user belongs and click the tenant name. Then, the Overview page appears.

    4. In the left-side navigation pane, click User Management.

    5. In the user list, click Delete in the Actions column of the user that you want to drop.

    6. In the confirmation dialog box that appears, click Delete.

    Previous topic

    Lock and unlock a user
    Last

    Next topic

    Set and view the tenant allowlist
    Next
    What is on this page
    Drop a user by using an SQL statement
    Drop a user in the OCP console
    Prerequisites
    Procedure