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 Connector/NET

V1.0.0

  • What Is OceanBase Connector/NET
    • Introduction
  • Install and Connect
    • Installation process
    • Test the connection
    • Reference a NuGet package
  • User Guide
    • Quick Start
      • Complete example
    • Connection Strings and Data Source
      • Connection strings
    • Data Types
      • Overview of data types
    • Command and Parameter
      • Overview
    • Result Set
      • Supported result set types
  • Reference Information
    • Common Interfaces
      • Overview of commonly used interfaces
  • Version Release Records
    • OceanBase Connector/NET V1.0.0

Download PDF

Introduction Installation process Test the connection Reference a NuGet package Complete example Connection strings Overview of data types Overview Supported result set types Overview of commonly used interfaces OceanBase Connector/NET V1.0.0
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 Connector/NET
  3. V1.0.0
iconOceanBase Connector/NET
V 1.0.0
  • V 1.1.0
  • V 1.0.0

Connection strings

Last Updated:2026-04-10 07:38:32  Updated
share
What is on this page
MySQL mode
Oracle mode
Basic format
Main parameters
Full parameter list (by type)
Connection
TLS
Pooling
OceanBase
Other

folded

share

OceanBase Connector/NET supports connecting to OceanBase Database in Oracle mode and MySQL mode. The connection methods are as follows:

  • MySQL mode: The connection method is the same as that of MySqlConnector, using the standard MySQL connection string format and parameters.
  • Oracle mode: The connection method uses Oracle-compatible APIs, with a connection string format similar to that of Oracle ODP.NET.

MySQL mode

When you connect to OceanBase Database in MySQL mode, you use the same connection string format and parameters as those for MySqlConnector, for example:

Server=host;Port=port;Database=database_name;Uid=username@tenant_name#cluster_name;Pwd=password;

Note

For connections through ODP, the user field is usually a three-part value: Username@TenantName#ClusterName (this maps to Uid in MySQL mode). Some cloud deployments also support shorthand forms. Replace tenant_name and cluster_name with your actual tenant and cluster names.

Oracle mode

Basic format

Data Source=host:port;User Id=username@tenant_name#cluster_name;Password=password;Database=schema_name;

Note

Data Source supports only host or host:port. It does not support appending /servicename. If you need a service name, specify it using another connection string parameter.

For connections through ODP, User Id is usually the three-part form: Username@TenantName#ClusterName. Some cloud deployments also support shorthand forms such as a one-part user name. Follow your environment. Replace username, tenant_name, and cluster_name with real values.

Main parameters

Parameter Description
Data Source The data source address. Only host or host:port is supported; the host:port/servicename form is not supported. host is the IP address or hostname of the OBServer or ODP node. port is 2881 for direct connections or 2883 for connections through ODP. If a service name is required, set it using another parameter. Do not append it to Data Source.
User Id User identity. For ODP connections, this is usually the three-part form: Username@TenantName#ClusterName, consistent with the User Id value in the connection string. Some cloud deployments support shorthand forms.
Password The password of the database.
Database Mandatory. In Oracle mode, this parameter must be set to the schema name. Otherwise, Open will throw an ArgumentException.
UseLobLocatorV2 Specifies whether to enable the LOB Locator feature. The default value is true.

Note

This topic describes the connection parameters. For an overview of the interface capabilities, see Common Interfaces. The driver is based on MySqlConnector. The connection parameters are consistent with those of MySqlConnector. Some parameters have adjusted default values: ConnectionReset defaults to false, and SslMode defaults to None.

Full parameter list (by type)

Connection

Parameter (Common) Type Default Value Description
Server / Host / Data Source string "" The server address. Multiple hosts are supported and separated by commas.
Port uint 3306 The port number.
User ID / UserID / Username / Uid string "" User identity. In multi-tenant deployments, ODP connections usually use the three-part form: Username@TenantName#ClusterName. Some cloud deployments support shorthand forms.
Password / Pwd string "" The password.
Database / Initial Catalog string "" The initial database (schema), which is required for the Oracle mode.
Load Balance / LoadBalance enum RoundRobin The load balancing strategy for multiple hosts.
Connection Protocol / Protocol enum Socket The connection protocol.
Pipe Name / PipeName string "MYSQL" The name of the named pipe, which is valid only for the NamedPipe protocol.
Connection Timeout / Connect Timeout uint 15 The connection timeout (seconds).
Interactive Session / Interactive bool false Specifies whether to enable an interactive session.
Keep Alive / Keepalive uint 0 The TCP keepalive idle time (seconds). 0 indicates the default system value.
Server Redirection Mode enum Disabled Specifies whether to enable server redirection.
Server RSA Public Key File string "" The path of the server RSA public key.
Server SPN string "" The server SPN.

TLS

Parameter (Common) Type Default Value Description
SSL Mode / SslMode enum None The SSL mode.
Certificate File string "" The path of the client certificate file (.pfx).
Certificate Password string "" The certificate password.
Certificate Store Location enum None The certificate storage location.
Certificate Thumbprint string "" The certificate fingerprint.
SSL Cert / SslCert string "" The path of the client PEM certificate.
SSL Key / SslKey string "" The path of the client PEM private key.
SSL CA / SslCa string "" The path of the CA certificate.
TLS Version / TlsVersion string "" The allowed TLS version.
TLS Cipher Suites string "" The allowed cipher suites.

Pooling

Parameter (Common) Type Default Value Description
Pooling bool true Specifies whether to enable connection pooling.
Connection Lifetime / ConnectionLifeTime uint 0 The maximum connection lifetime (seconds).
Connection Reset / ConnectionReset bool false Specifies whether to reset the connection state when a connection is taken from the pool.
Connection Idle Timeout / ConnectionIdleTimeout uint 180 The connection pool idle timeout (seconds).
Minimum Pool Size / Min Pool Size uint 0 The minimum number of connections.
Maximum Pool Size / Max Pool Size uint 100 The maximum number of connections.
DNS Check Interval / DnsCheckInterval uint 0 The DNS change check interval (seconds).

OceanBase

Parameter (Common) Type Default Value Description
Use LOB Locator V2 / UseLobLocatorV2 bool true Specifies whether to enable OceanBase LOB Locator V2.

Other

Parameter (Common) Type Default Value Description
Allow Load Local Infile bool false Whether to allow LOAD DATA LOCAL.
Allow Public Key Retrieval bool false Whether to allow retrieving an RSA public key from the server.
Allow User Variables bool false Whether to allow the use of user variables in SQL.
Allow Zero DateTime bool false Whether to allow zero date values.
Application Name string "" Application name (connection property).
Auto Enlist / AutoEnlist bool true Whether to automatically register with TransactionScope.
Cancellation Timeout int 2 Command cancellation timeout (seconds).
Convert Zero DateTime bool false Whether to convert invalid dates to DateTime.MinValue.
DateTime Kind enum Unspecified Deserialization of DateTimeKind.
Default Command Timeout / Command Timeout uint 30 Default command timeout (seconds).
Force Synchronous bool false Whether to force asynchronous APIs to execute synchronously.
GUID Format / GuidFormat enum Default Guid mapping format.
Ignore Command Transaction bool false Whether to ignore command transaction consistency checks.
Ignore Prepare bool false Whether to ignore Prepare calls.
No Backslash Escapes bool false Whether to disable backslash escaping.
Persist Security Info bool false Whether to retain sensitive information after the connection is established.
Pipelining bool true Whether to enable pipelining.
Treat Tiny As Boolean bool true Whether to treat TINYINT(1) as a boolean.
Use Affected Rows bool false Whether to return the number of affected rows.
Use Compression / Compress bool false Whether to compress network transmission.
Use XA Transactions bool true Whether to use XA with TransactionScope.
Character Set / CharSet string utf8mb4 Character set parameter, retained for compatibility.

Previous topic

Complete example
Last

Next topic

Overview of data types
Next
What is on this page
MySQL mode
Oracle mode
Basic format
Main parameters
Full parameter list (by type)
Connection
TLS
Pooling
OceanBase
Other