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.6

  • Overview
  • Driver installation and configuration
    • Prepare for the installation
    • Install and configure OceanBase Connector/ODBC for Linux
    • Install and configure OceanBase Connector/ODBC for Windows
  • User guide
    • Basic operations
    • Enable logging
  • Reference information
    • API functions in OceanBase Connector/ODBC
    • Data types in OceanBase Connector/ODBC
    • Error codes in OceanBase Connector/ODBC
  • FAQ
    • Query timeout
    • Chinese garbled characters

Download PDF

Overview Prepare for the installation Install and configure OceanBase Connector/ODBC for Linux Install and configure OceanBase Connector/ODBC for Windows Basic operations Enable logging API functions in OceanBase Connector/ODBC Data types in OceanBase Connector/ODBC Error codes in OceanBase Connector/ODBC Query timeout Chinese garbled characters
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.6
iconOceanBase Connector/ODBC
V 2.0.6
  • 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
ISQL connectivity test
Compile a C++ test program

folded

share

After you obtain the installation packages 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 of any version has been installed and query the version.
rpm -qa | grep odbc
rpm -qa | grep obclient
  1. If you want to install another version, run the following commands to delete the current version.
rpm -e ob-connector-odbc-<version_no>.rpm   
rpm -e libobclient-<version_no>.rpm   
rpm -e ob-unixodbc-<version_no>.rpm   
  1. Install the RPM packages of OceanBase Connector/ODBC of the target version.
sudo rpm -ivh ob-connector-odbc-<version_no>.rpm  
sudo rpm -ivh ob-unixodbc-<version_no>.rpm
sudo rpm -ivh libobclient-<version_no>.rpm  
  1. Check whether the version is correct.
rpm -qa | grep odbc
rpm -qa | grep obclient

Install the required Libtool tool based on the 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 to the custom directory.
$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 is user-defined.
Description The description of the driver.
SERVER The IP address of the database.
PORT The port number of the database.
USER The username that you use to log on to the database.
Password The password that you use to log on to the database.
Database The name of the database.
OPTION The configuration option. Valid value: OPTION=4, which indicates to enable logging.
charset The character set of the database. Default value: UTF8.
  1. Put the odbcinst.ini configuration file in the /etc/odbcinst.ini directory.
$sudo vim /etc/odbcinst.ini

[Oceanbase]
Description = ODBC for Oceanbase
Driver = /u01/ob-connector-odbc/lib64/mariadb/libobodbc.so
  1. Set environment variables.
$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
  1. Run the odbcinst -j command to check whether the environment variables are correct. Example:
$/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
  1. Check whether the environment dependencies are correct.
$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

ISQL connectivity test

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

$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 OceanBase Connector/ODBC for Windows
Next
What is on this page
Install OceanBase Connector/ODBC
Configure environment variables
Test connectivity
ISQL connectivity test
Compile a C++ test program