Document Type | Technical Information
Category | Administration
Applicable Product Version | T7, T6
Document Number | TADTI126
Overview
This document provides instructions on how to configure a DB Link from Tibero database to MySQL database and how to handle possible errors.
Test Information
- Tibero: Tibero 7 (DB 7.0 FS02) Build 261550
- MySQL: 9.0.1
Method
1. DB Link Configuration Steps
1) Copy / Extract gateway file
cp $TB_HOME/client/bin/tbJavaGW.zip /home/tibero/.unzip $TB_HOME/client/bin/tbJavaGW.zip
2) Add environment variable to profile
export TBGW_HOME=/home/tibero/tbJavaGW
3) Edit gateway config file (jgw.cfg)
vi $TBGW_HOME/jgw.cfg
[Configuration Example]
# Target database DATABASE=MYSQL # Datasource class name for target database DATASOURCE_CLASS_NAME=com.mysql.cj.jdbc.MysqlDataSource # XA datasource class name for target database XA_DATASOURCE_CLASS_NAME=com.mysql.cj.jdbc.MysqlXADataSource # Listener port - gateway listener port LISTENER_PORT=1234 # Gateway Encoding - must be the same as mysql charset ENCODING=UTF-8 # Transaction isolation level TRANSACTION_ISOLATION_LEVEL="READ COMMITTED" # MySQL JDBC Connection URL Format # - jdbc:mysql://[host][:port][/database][MYSQL_PROPERTY] MYSQL_PROPERTY=?PublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Seoul
* Restrictions/Notes: MySQL JDBC Connector version-specific settings
- When using version 5:
DATASOURCE_CLASS_NAME=com.mysql.jdbc.jdbc2.optional.MysqlDataSource - Version 8 or higher:
DATASOURCE_CLASS_NAME=com.mysql.cj.jdbc.MysqlDataSource - For detailed parameter descriptions in
jgw.cfg, refer to the Tibero 7 manual.
4) Configure gateway library
- Copy the MySQL JDBC to the
$TBGW_HOME/libpath. - Reflect the JDBC driver name in the
$TBGW_HOME/tbgwfile.
Example: mysqljdbc โ ./lib/mysql_jdbc_name
5) Run gateway
cd $TBGW_HOME./tbgw
6) Configure MySQL connection info (tbdsn.tbr)
vi $TB_HOME/client/config/tbdsn.tbr
Example:
link=(
(GATEWAY=localhost)
(PORT=1234))
(TARGET=192.168.56.11:3306:jh_db)
(TX_MODE=GLOBAL))
)For descriptions of each parameter, refer to the gateway process creation method in the Tibero 7 manual.
7) Create DBLINK
create database link link_name connect to 'mysql_user' identified by 'password' using 'alias';
Example:
create database link m_link connect to 'jh' identified by 'tibero' using 'link';
8) Test DBLINK
Example:
select * from employees@m_link;
2. Error Handling
Note: If you modify jgw.cfg while the gateway is running, you must restart it.
1) TBR-130005 Occurs (Time Zone Error)
TBR-12130: Unable to connect to remote database. TBR-130005: Authentication failed - The server time zone value is unrecognized.
Solution: Modify jgw.cfg as below.
MYSQL_PROPERTY=?serverTimezone=Asia/Seoul
2) SSL-related Warning Occurs
The link executes, but an SSL Warning message appears.
Solution:
MYSQL_PROPERTY=?PublicKeyRetrieval=true&useSSL=false
3. How to Restart Gateway
- Kill the gateway process (
ps -ef | grep tbgwโkill) - Restart:
cd $TBGW_HOME./tbgw