[MDEV-20201] Connecting to remote MySQL via ODBC crashes server Created: 2019-07-29 Updated: 2019-09-02 Resolved: 2019-09-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.3.15, 10.4.6 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Hans | Assignee: | Olivier Bertrand |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5+deb10u1 (2019-07-19) x86_64 GNU/Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
Today, I've setup a fresh Debian 10.0 headless server with MariaDB 10.3.15 and wanted to connect to a remote Percona MySQL 5.7.25. As ENGINE=CONNECT TABLE_TYPE=MySQL does not allow SSL secured connections, I have to use ODBC.
With isql -v fashion I can connect without any problem and query remote server. But when trying to use this DSN in MariaDB with
I get an error ERROR 2013 (HY000): Lost connection to MySQL server during query when trying to run SELECT * FROM my_tables.
|
| Comments |
| Comment by Olivier Bertrand [ 2019-07-30 ] |
|
Just one question before I work on this issue: what makes MYSQL tables unable to make SSL connections? And is this the same using the FEDERATED engine? |
| Comment by Olivier Bertrand [ 2019-07-30 ] |
|
I tried to reproduce this on Windows with no error. Note that ODBC is an original Windows feature that has been adapted on Linux by different products such as UnixODBC. Looking into your log listing, it appears that the error occured into UnixODBC. That is not the first time such problems occur on Linux. A safer method seems to use JDBC instead of ODBC. The JDBC Java code is the same on Windows and Linux, and it appears that there are less such issues with JDBC than with ODBC. |
| Comment by Hans [ 2019-07-31 ] |
|
I can use FEDERATED or CONNECT TABLE_TYPE=MYSQL, but only for MySQL servers which do not force a SSL connection. For MySQL SSL connections I've been dependant on unixODBC which works fine when using "isql" CLI tool but not when using CONNECT TABLE_TYPE=ODBC. Regarding https://jira.mariadb.org/browse/MDEV-10936 I've installed OpenJDK 11 but when using TABLE_TYPE=JDBC I get "ERROR 1296 (HY000): Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT" but don't know where to place JavaWrappers.jar. EDIT: OMG, got JDBC working. For a Java noob it's really hard to deal with all this paths and JAR files. As setting CLASSPATH in /etc/profiles is ignored in MariaDB I'm going to check another approach for persisting these paths. |
| Comment by Olivier Bertrand [ 2019-07-31 ] |
|
Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT" but don't know where to place JavaWrappers.jar Look in the MariaDB documentation for CONNECT. In the chapter about JDBC tables, sub-chapter Java Class Path explains what to do for setting the CLASS PATH that is used to indicate where are the required *.jar files. These are the drivers used for the connections and the JavaWrappers.jar that contains the JdbcInterface class. |
| Comment by Olivier Bertrand [ 2019-07-31 ] |
|
As setting CLASSPATH in /etc/profiles is ignored in MariaDB I'm going to check another approach for persisting these path Perhaps by setting connect_class_path in my.cnf. |
| Comment by Hans [ 2019-08-01 ] |
|
Thanks for your help. I'm going to look how to set the variables permanently and I think I'll give JDBC a try for my project. Please decide on your own, what to do with this ticket. But I can't believe that this problem is related to unixODBC only. Also, I understand that it is hard to deal with it, as it could be related to MariaDB, to unixODBC and to MySQL too (because driver from DevArt is working). |
| Comment by Olivier Bertrand [ 2019-09-02 ] |
|
Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT" but don't know where to place JavaWrappers.jar Normally it is placed in the plugin directory and automatically recognized. However, if it was not done, it might be the best directory to place it into. I did not test this on Linux myself but several customers use JDBC successfully on Linux. Incidentally, I was only signaled today by JIRA of your last comment dating... one month ago. |