OceanBase logo

OceanBase

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

Product Overview
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

OceanBase

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

Product Overview
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 - V4.2.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive DemosTraining & CertificationTicket
    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. V4.2.0
    iconOceanBase Database
    SQL - V 4.2.0
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • 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

    Connect to OceanBase Database by using ODC

    Last Updated:2023-11-24 02:58:23  Updated
    Share
    What is on this page
    Prerequisites
    Procedure
    References

    folded

    Share

    OceanBase Developer Center (ODC) allows you to connect to a MySQL tenant of OceanBase Database. This topic describes how to connect to OceanBase Database by using ODC.

    Prerequisites

    You have deployed ODC and obtained the URL of Web ODC. For more information about how to deploy ODC, see Deployment of ODC.

    Procedure

    This topic provides an example of creating a private connection by using Web ODC. The procedure is as follows:

    1. On the logon page of ODC, enter your registered account, the password, and the verification code, and then click Log On.

    2. On the Private Connections tab of the homepage, click Create Connection in the upper-right corner to create a private connection.

      Note

      When you run ODC for the first time, the loading time may take a bit longer than usual.

    3. Specify the following parameters on the Create Connection tab. If you have an OceanBase Database connection string, which is in the format of mysql -h <host name> -P <port number> -u <database username@tenant name> # <cluster name> -D <default database> -p '<database password>', you can obtain the information from the string. You can also paste the string in the field of Intelligent Parsing in the dialog box to automatically populate these parameters.

      Parameter
      Description
      Database Type Select Physical Database or Logical Database.
      • Physical Database: regular databases.
      • Logical Database: ODP (Sharding).
      Region Select Independent Deployment/ApsaraStack as the region for the connection example.
      Connection Name Specify the name of the connection.
      Set Tag You can add some descriptive information for the connection.
      Click the Set Tag button next to Connection Name to set a tag for the current connection. You can set and manage tags in the drop-down list that appears.
      • Tag setting: Select a tag from the drop-down list. Create tags first if the list is empty.
      • Tag management: Click Create Tag at the bottom of the list or the settings icon above the list to go to the Tags page, where you can edit or delete created tags. You can also click Create Tag to set a name or color for the new tag.
      Intelligent Parsing You can paste a connection string to the text box. ODC automatically identifies the string and fills in the corresponding values.
      Connection Mode Select MySQL. Logical databases support only the MySQL mode.
      Endpoint
      • Host IP: the IP address of the server where the target database is located.
      • Port: the port number of the server where the target database is located.
      • Cluster: the name of the cluster where the target database is located. This parameter is not required for logical databases.
      • Tenant: the name of the tenant in which the target database is located. This parameter is not required for logical databases.

      Note

      You can obtain the host name and port number from the details page of the tenant in which the target database is located, such as a tenant created on Alibaba Cloud or in OceanBase Cloud Platform (OCP).

      Database Account
      • Database Username: the username of an account created in the tenant. In the MySQL mode of OceanBase Database, this account must have the privilege to access the default database.
      • Password: the password of the account created in the tenant. You can click Test Connection next to the password box to test whether you can connect to the target database.
      • Save Password: If you deselect this option, the database password for the connection is not saved, and you must enter the database password in the password dialog box each time you use or test the connection. If you select this option, the database password for the connection is saved, and you do not need to enter the database password each time you use the connection.

      Note

      • An error will be returned if the configurations such as the username, password, and network settings are invalid.
      • You can only connect to a database in the current tenant. Otherwise, a test failure error will be returned.
      • In ODC V4.0.0 and later, you can save the connection without entering the database account and password.

      Default Database/Schema (Optional) When you connect to a MySQL tenant of OceanBase Database, you must specify the default database for the connection.

      Note

      If you leave this parameter unspecified in the MySQL mode of OceanBase Database, the information_schema database is connected by default. However, if the connection to the information_schema database fails, you need to specify a database that can be accessed by the current user.

      SQL Query Timeout Value You can specify a timeout value for SQL queries. A query whose execution time exceeds the timeout value is automatically terminated. The default timeout value is 60 seconds.
      sys Tenant Account Settings Choose whether to select Query Tenant Views with sys Tenant Account. If you select this option, specify Account and Password.
      When Database Type is set to Physical Database, you can specify an account that has the privilege to query sys tenant views, and the password. The account and password are automatically populated when sys is specified as the tenant in Endpoint.
      • Account: an account that has the privilege to query the views under the sys tenant.
      • Password: the password of the account.
      After you specify the account and password, you can click Test Connection next to the password box to verify whether the account information is valid.

      Note

      • In ODC V2.3.0 and later, to use the import and export features, you need to configure the root@sys account in the Advanced Configuration section when you create a connection.
      • In ODC V2.4.1 and later, the strong dependency on the root@sys account is removed when you query views for import or export. If the root@sys account is not configured, some ODC objects such as stored procedures and functions do not support the export feature. If the root@sys account is configured, you can access the views under the sys tenant to obtain the optimal data routing strategy, which can increase the export speed.
      • The account and password of the sys tenant are the account and password of a user in a tenant of the cluster. Do not enter @sys#cluster in the Account parameter. For example, the account can be root.

    4. Click Save to save the current configuration in the ODC connection list. When you log on to ODC the next time, you can directly select the connection from the list. The connection configuration does not necessarily need to pass the connection test when you save the configuration.

      Note

      Before you save the configuration, you can click Test Connection to test the database connection. If the database username and password are correct, the system returns a message indicating that the connection succeeded.

    References

    For more information about other features of ODC, see the ODC documentation in OceanBase Documentation Center.

    Previous topic

    Connect to an OceanBase Database tenant by using OBClient
    Last

    Next topic

    Connect to OceanBase Database by using Spring Boot
    Next
    What is on this page
    Prerequisites
    Procedure
    References