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

V2.0.7

  • Overview
  • Driver installation and configuration
    • Prepare for the installation
    • Install and configure OceanBase Connector/ODBC for Linux
    • Install and configure the OceanBase Connector/ODBC driver for Windows
  • User guide
    • Basic operations
    • Enable the logging feature
    • Obtain the REF CURSOR data type
  • Reference information
    • OceanBase Connector/ODBC API functions
    • OceanBase Connector/ODBC data types
    • OceanBase Connector/ODBC error codes
  • FAQ
    • Query timeout
    • Chinese garbled characters
  • Release
    • V2.0
      • OceanBase Connector/ODBC V2.0.7
      • OceanBase Connector/ODBC V2.0.6

Download PDF

Overview Prepare for the installation Install and configure OceanBase Connector/ODBC for Linux Install and configure the OceanBase Connector/ODBC driver for Windows Basic operations Enable the logging feature Obtain the REF CURSOR data type OceanBase Connector/ODBC API functions OceanBase Connector/ODBC data types OceanBase Connector/ODBC error codes Query timeout Chinese garbled characters OceanBase Connector/ODBC V2.0.7 OceanBase Connector/ODBC V2.0.6
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/ODBC
  3. V2.0.7
iconOceanBase Connector/ODBC
V 2.0.7
  • V 2.0.9
  • V 2.0.8
  • V 2.0.7
  • V 2.0.6

Install and configure OceanBase Connector/ODBC for Linux

Last Updated:2026-04-09 07:12:04  Updated
share
What is on this page
Install OceanBase Connector/ODBC
Configure environment variables
Test connectivity
Test ISQL connectivity
Compile a C++ test program

folded

share

After you obtain the installation package of OceanBase Connector/ODBC for Linux, perform the following operations to install and configure OceanBase Connector/ODBC.

Install OceanBase Connector/ODBC

  1. Check whether OceanBase Connector/ODBC is installed. If so, query its version information.

     ```bash
     rpm -qa | grep odbc
     rpm -qa | grep obclient
     ```
    
  2. If you need another version, run the following commands to delete the current one.

     ```bash
     rpm -e ob-connector-odbc-<version_no>.rpm   
     rpm -e libobclient-<version_no>.rpm   
     rpm -e ob-unixodbc-<version_no>.rpm   
     ```
    
  3. Install the RPM package of OceanBase Connector/ODBC of the target version.

     ```bash
     sudo rpm -ivh ob-connector-odbc-<version_no>.rpm  
     sudo rpm -ivh ob-unixodbc-<version_no>.rpm
     sudo rpm -ivh libobclient-<version_no>.rpm  
     ```
    
  4. Check whether the version is correct.

     ```bash
     rpm -qa | grep odbc
     rpm -qa | grep obclient
     ```
    

Install the required Libtool based on the actual environment.

yum install libtool-ltdl-devel  

Configure environment variables

  1. Put the odbc.ini configuration file in the /etc/odbc.ini directory. You can also put the file in a custom directory and set the environment variable corresponding to the file in the custom directory.

     ```bash
     $sudo vim /etc/odbc.ini
    
     [ODBC Data Sources]
     data_source_name = OBDSN
    
     [OBDSN]
     Driver=Oceanbase
     Description = OceanBase Driver DSN  
     SERVER = xxx.xxx.xxx.xxx
     PORT = 10003
     USER = tester@oracle
     Password = 1******
     Database = unittests
     OPTION = 4
     charset=UTF8
    
     [OBDSNMYSQL]
     Driver=Oceanbase
     Description = OceanBase Driver DSN  
     SERVER = xxx.xxx.xxx.xxx
     PORT = 10003
     USER = tester@sys
     Password = 1******
     Database = unittests
     OPTION = 4
     charset=UTF8
     ```
    
     The following table describes the parameters in the configuration file.
    
     | **Parameter** | **Description** |
     | --- | --- |
     | Driver | The driver in the odbcinst.ini configuration file, which can be customized.  |
     | Description | The description of the driver.  |
     | SERVER | The IP address of the database.  |
     | PORT | The port number of the database.  |
     | USER | The username to log in to the database.  |
     | Password | The password to log in to the database.  |
     | Database | The name of the database.  |
     | OPTION | The configuration option. Valid value: 4, which indicates that logging is enabled.  |
     | charset | The character set of the database. Default value: UTF8.  |
    
  2. Put the odbcinst.ini configuration file in the /etc/odbcinst.ini directory.

     ```bash
     $sudo vim /etc/odbcinst.ini
    
     [Oceanbase]
     Description = ODBC for Oceanbase
     Driver = /u01/ob-connector-odbc/lib64/mariadb/libobodbc.so
     ```
    
  3. Set environment variables.

     ```bash
     $export ODBCSYSINI=/etc
     $export ODBCINI=/etc/odbc.ini
     $export LD_LIBRARY_PATH=/u01/unix-odbc/lib:/u01/obclient/lib:/u01/ob-connector-odbc:$LD_LIBRARY_PATH
     ```
    
  4. Run the odbcinst -j command to check whether the environment variables are correct. Example:

     ```bash
     $/u01/unix-odbc/bin/odbcinst -j
    
     unixODBC 2.3.0
     DRIVERS............: /etc/odbcinst.ini
     SYSTEM DATA SOURCES: /etc/odbc.ini
     FILE DATA SOURCES..: /etc/ODBCDataSources
     USER DATA SOURCES..: /etc/odbc.ini
     SQLULEN Size.......: 8
     SQLLEN Size........: 8
     SQLSETPOSIROW Size.: 8
     ```
    
  5. Check whether the environment dependencies are correct.

     ```bash
     $cd /u01/ob-connector-odbc/lib64/mariadb
    
     [root@eefdc4281eb7 mariadb]# ldd /u01/ob-connector-odbc/lib64/mariadb/libobodbc.so
             linux-vdso.so.1 =>  (0x00007fffd4bf0000)
             libobclnt.so.20 => /u01/mysql/lib/libobclnt.so.20 (0x00007f62a8df2000)
             libodbcinst.so.2 => /u01/unix-odbc/lib/libodbcinst.so.2 (0x00007f62a8bdd000)
             libm.so.6 => /lib64/libm.so.6 (0x00007f62a88db000)
             libc.so.6 => /lib64/libc.so.6 (0x00007f62a850d000)
             libdl.so.2 => /lib64/libdl.so.2 (0x00007f62a8309000)
             libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f62a80ed000)
             libltdl.so.7 => /lib64/libltdl.so.7 (0x00007f62a7ee3000)
             /lib64/ld-linux-x86-64.so.2 (0x00007f62a92c4000)
    
     # Make sure that the dependency of libobclnt.so.20 matches the libobclient-xxx.rpm package installed.
     ```
    

Test connectivity

Test ISQL connectivity

Tools related to the driver manager are stored in the /u01/unix-odbc directory. Run the connection command and check whether the connection is successful.

$sudo vim /u01/unix-odbc/bin/isql -v OBDSN
+-------------------------------+
|  Connected!                   |
|                               |
|  sql-statement                |
|  help [tablename]             |
|  quit                         |
|                               |
+-------------------------------+
SQL>

Compile a C++ test program

g++  -I /u01/unix-odbc/include/   test.cpp  -lobodbc -o test

Previous topic

Prepare for the installation
Last

Next topic

Install and configure the OceanBase Connector/ODBC driver for Windows
Next
What is on this page
Install OceanBase Connector/ODBC
Configure environment variables
Test connectivity
Test ISQL connectivity
Compile a C++ test program