Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-28500: connection from ORACLE to a non-Oracle system returned this message ORA-02063: preceding line from MYSQL_DBLINK

Ubai SalihNov 3 2024 — edited Nov 17 2024

i want to create db link from oracle to mysql with following configuration

Environment:

  • Oracle Version: 19c
  • OS: Oracle Linux
  • MySQL ODBC Driver: MySQL ODBC 9.1 Unicode Driver
  • HS Gateway Version: 19.0.0.0.0

I would appreciate any guidance on how to troubleshoot these issues or any recommendations for proper configurations. Thank you!

# Listener configuration

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = mysql_odbc_dsn_name)
(ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)
(PROGRAM = dg4odbc)
)
)
------------------------------------------------

/etc/odbc.ini

[mysql_odbc_dsn_name]
Description = MySQL ODBC DSN
Driver = MySQL ODBC 9.1 Unicode Driver
Server = Server
Database = DB
User = username
Password = password
Port = 3306
TRACE = ON

-----------------------------------------

[oracle@oracle-db-prod admin]$ isql mysql_odbc_dsn_name
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>

[oracle@oracle-db-prod admin]$ cat initmysql_odbc_dsn_name.ora
# Example initmysql_odbc_dsn_name.ora
HS_FDS_CONNECT_INFO = "mysql_odbc_dsn_name"
HS_FDS_TRACE_LEVEL = DEBUG
ODBCINI = /etc/odbc.ini
HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so

[oracle@oracle-db-prod admin]$

– – – – – – – – – – – – – – – – – – – –

# tnsnames.ora

mysql_odbc_dsn_name =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname )(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = mysql_odbc_dsn_name)
)
(HS = OK)
)

– — – – – – – – — — — — ----- ------ -----------------------

CREATE DATABASE LINK mysql_dblink
CONNECT TO username IDENTIFIED BY "password"
USING 'mysql_odbc_dsn_name';

SELECT * FROM table @MYSQL_DBLINK;

ORA-28500: connection from ORACLE to a non-Oracle system returned this message ORA-02063: preceding line from MYSQL_DBLINK

and from hs logs i got this

Failed to load ODBC library symbol: /usr/lib64/libmyodbc5w.so(SQLSetDescRec)
Exiting hgolofn, rc=28500 at 2024/11/17-10:27:24
Exiting hgoinit, rc=28500 with error ptr FILE:hgoinit.c LINE:442 ID:Loading ODBC aray of function ptrs
HOA 11/17 10:27:24.165277000: (hotker_ExecuteRpcs) ncrorpi: status = 0
Entered hgoexit
HS Gateway: NULL connection context at exit
Exiting hgoexit, rc=0 with error ptr FILE:hgoexit.c LINE:118 ID:Connection context

Comments
Post Details
Added on Nov 3 2024
0 comments
131 views