Skip to Content
0
Mar 22 at 03:42 PM

Connect SAP to MySQL-Database via ODBC

159 Views Last edit Mar 22 at 03:54 PM 3 rev

Hello together,

we need to setup a connection to a MySQL-database in order to read / write some information to this database using ABAP.

We have the following setup:

  • SAP Application Server: Windows Server 2016 with SAP Netweaver: 7.5 / SAP ERP EHP8 for SAP ERP 6.0 (64 bit)
  • Linux server with MySQL version 8.0.23 (64 bit)

What I did so far: I followed the comment from Gudmundur Karlsson:

  1. Installed the MySQL ODBC 8.0.23 driver from here on the Windows application server
  2. Setup the connection as "System DSN" using the 64-bit Unicode-Driver in the ODBC Data Source Administrator and named it TEST (Connection-test is successful)
  3. In T-Code DBCO, we created the connection with the following parameters:
  • DBMS: MSS
  • Username & Password: Database-Username & Password (same as in the System DSN setting)
  • CON_ENV: MSSQL_DSN=TEST (also tried with MSSQL_DATASOURCE=TEST)

When I do a connection test in SAP DBACOCKPIT, I am getting the following error:

-- ERROR Database connection Z_TEST: ADBC error 'Internal error  1  has occured'

With the report ADBC_TEST_CONNECTION, I am getting the following error:

Could not open connection Z_TEST  .

sql error  0  occured:

On the same SAP system, we have access to a Microsoft SQL - Database (also configured via DBCO) which works fine, so I think the basics like dbmssslib.lib are all installed.

As a test, I tried to connect to the MySQL-Database from Excel using the ODBC driver and there was also no problem at all, so the driver itself seems to work.

When I enable the trace in ODBC Data Source Administrator and do the connection test there, a trace file gets generated - but when I do the connection test from SAP DBACOCKPIT, nothing happens and nothing gets written to the logfile, so it seems like SAP has problems communication with the ODBC service on Windows.

Does anyone have an idea of how to solve this issue?

Any help appreciated! Thanks!