Bug #60340 iODBC fails with myodbc 5.1.
Submitted: 4 Mar 2011 15:22 Modified: 28 May 2013 14:09
Reporter: Cristian S Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.1.6-1, 5.1.7 OS:Linux (Debian GNU/Linux 6.0 (squeeze))
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: iodbc_fails_myodbc_5.1

[4 Mar 2011 15:22] Cristian S
Description:
It seems that iODBC doesn't get along with myodbc 5.1, at least not on my Debian 6 system (also a RHEL 5.6 system has the very same problem).

Debian 6:
I tried to connect an application using this combination (iodbc 3.52.6-4 and myodbc 5.1.6-1) but had no success.

Packages installed on the system:

Package: libmyodbc
Architecture: amd64
Version: 5.1.6-1

Package: libiodbc2
Architecture: amd64
Version: 3.52.6-4

Package: mysql-server
Version: 5.1.49-3

How to repeat:
1. Install the mentioned packages (and start MySQL server, of course).

2. Create a test database and a user to login with.

mysql> create database dummy;
mysql> grant all privileges on dummy.* to 'user'@'localhost' identified by 'password';
mysql> flush privileges;

3. Set /etc/odbc.ini as follows:
[iodbc]
Driver = /usr/lib/odbc/libmyodbc.so
Server = localhost
Socket = /var/run/mysqld/mysqld.sock
User = user
Password = password
Database = dummy
Trace = yes
TraceFile = /tmp/trace.log

4. Test the connection with iodbctest:

# iodbctest DSN=iodbc
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0607.1008
1: SQLDriverConnect = ��������������������������������� (0) SQLSTATE=A
1: ODBC_Connect = ��������������������������������� (0) SQLSTATE= �

This happens also on RHEL 5.6.

In place of the binary mess, shouldn't be a text there?

Anyway, the previous version of myodbc was 3.51, and this works flawlessly with the mentioned iODBC lib. Also, there was a separate binary package for iodbc (something like: mysql-connector-odbc-3.51.27-iodbc-<distro>-x86-32bit.tar.gz) which is not the case with 5.1

i386 versions of iodbc and libmyodbc behave the very same way.

I hope I'm not wrong with the above observations.
[5 Mar 2011 15:46] Hugh Williams
This works for me on Mac OS X 10.6 (32bit Intel):

$ iodbctest "DSN=myodbc;UID=root;PWD=xxxxxxx"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0607.1008
Driver: 05.01.0005 (libmyodbc5.so)

SQL>select count(*) from teller

count(*)            
--------------------
100                 

 result set 1 returned 1 rows.

SQL>

ODBC DSN info:

[myodbc]
Driver = /usr/local/lib/libmyodbc5.so
SERVER = kingsleydemo.usnet.private
PORT   = 3306
DATABASE = mysql

Best Regards
Hugh Williams
OpenLink Software
[7 Mar 2011 8:31] Cristian S
Sorry, but the fact that it works on Mac OSX doesn't mean that it works :)
It still fails on Debian 6, RHEL 5.6 and maybe others.
I even tried with 5.1.8, same results.
[16 Jun 2011 9:50] Bogdan Degtyariov
Cristian,

MySQL Connector/ODBC 5.1 is not built with iODBC anymore.
I think your problem can be solved by building it from sources and specifying iODBC headers/libraries in configure script as follows:

./configure --with-iODBC=<iODBC Directory path> --with-iodbc-includes=<iODBC include directory path> --with-iodbc-libs=<iODBC lib directory path>
[16 Jul 2011 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[28 May 2013 14:09] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.