Bug #26292 MYSQL ODBC fails on AIX 5.3
Submitted: 12 Feb 2007 16:23 Modified: 15 Mar 2007 20:59
Reporter: Santanu Mitra Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.13r144 OS:IBM AIX (AIX 5.3)
Assigned to: Kent Boortz CPU Architecture:Any
Tags: AIX 5.3, linux, MySQL, ODBC, Oracle

[12 Feb 2007 16:23] Santanu Mitra
Description:
I have a Linux box where MYSQL DB server is installed.

I have another IBM  box running on AIX 5.3.

I was trying to installe mysql odbc on AIX box to connect to mysql server on linux box.

What I did?

On AIX box

1. Downloaded unixODBC-2.2.12.tar.Z
2. Installed unixODBC-2.2.12 successfully with no compilation errors.
   ./configure
    make
    make install
3. As per README.AIX in unixODBC-2.2.12 did these
      cd /usr/local/lib
      ar -x libodbcpsql.a (That created libodbcpsql.so.2)
      ar -x ibodbcpsqlS.a (That created ibodbcpsqlS.so.1)
4. Copied all lib* from unixODBC-2.2.12 install directory to /usr/loca/lib

5. Downloaded mysql-connector-odbc-3.51.13r144_20061219_1515-aix5.2-powerpc-64bit.tar.Z
6. tar xvf mysql-connector-odbc-3.51.13r144_20061219_1515-aix5.2-powerpc-64bit.atr
7. cd to mysql-connector-odbc-3.51.13r144_20061219_1515-aix5.2-powerpc-64bit extract location
8. Copied lib* from lib directory to /usr/local/lib

8. isql myodbc3 <mysql db user name> <mysql db pwd> -v

ERROR:
[ODBC][450664][SQLConnect.c][1034]Can't open lib '/usr/local/lib/libmyodbc3.so'
:       0509-022 Cannot load module /usr/local/lib/libmyodbc3.so.
        0509-103   The module has an invalid magic number.
[ODBC][450664][SQLError.c][424]

How to repeat:
Follow above steps 1-8 with following setup in odbc*.ini

odbc*.ini are located under /usr/local/etc

odbc.ini

[myodbc3]
Description  = MySQL ODBC 3.51 Driver DSN
Driver= mydriver
SERVER       = <ip address of linux server>
PORT         = 3306
USER         = <mysql db user id>
Password     = <mysql db pwd>
Database     = test
OPTION       = 3
SOCKET       =

odbcinst.ini

[mydriver]
Driver       = /usr/local/lib/libmyodbc3.so
Setup       = /usr/local/lib/libmyodbc3S.so
FileUsage = 1
CPTimeout =
CPReuse =

[ODBC]
Trace = 1
TraceFile = /tmp/sql.log
[15 Mar 2007 20:59] Kent Boortz
Thank you for your bug report. This issue has been fixed in
the latest released version of that product, which you can
download at

  http://www.mysql.com/downloads/

This is almost a duplicate of Bug#25155, but this also
is about how to build it. You need to set LDFLAGS to
"-Wl,-brtl" before configure, to instruct configure/libtool
to use the ".so" model, and support runtime loading.