Bug #40289 Install ODBC connector,"Symbol lookup error"
Submitted: 23 Oct 2008 19:22 Modified: 9 Dec 2008 14:12
Reporter: Thomas Lee Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.1.5 OS:Linux (Red Hat Linux ES 4.7)
Assigned to: CPU Architecture:Any
Tags: Install Issue

[23 Oct 2008 19:22] Thomas Lee
Description:
Since 3.51 installed before I need to replace the package 

[root@mastero2 linux-mysql-rpm-new]# rpm -iv --replacepkgs mysql-connector-odbc-5.1.5-0.i386.rpm
warning: mysql-connector-odbc-5.1.5-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing packages for installation...
mysql-connector-odbc-5.1.5-0
myodbc-installer: symbol lookup error: myodbc-installer: undefined symbol: SQLInstallDriverExW
error: %post(mysql-connector-odbc-5.1.5-0.i386) scriptlet failed, exit status 127

I run setup command have error:

[root@mastero2 linux-mysql-rpm-new]#  myodbc-installer  -s -a -c2 -n "test" -t "DRIVER=MySQL ODBC 5.1 Driver;SERVER=localhost;DATABASE=test;UID=root;PWD=system"
myodbc-installer: symbol lookup error: myodbc-installer: undefined symbol: SQLValidDSNW

How to repeat:
Just DL connector from your web and run rpm as above at RH Linux ES 4.7
[24 Oct 2008 15:54] Tonci Grgin
Hi Thomas and thanks for your report.

I do not think it's a bug and here's why:
  3.51 worked ok as it *does not* have "W" (Unicode) functions
  5.1 doesn't work as it has unicode support ("W" functions)

When negotiating with your driver manager, c/ODBC 5.1 did not found unicode support thus the error thrown. What I think you should do is get yourself a *unicode* version of your driver manager (UnixODBC, iODBC ...) and install it. After that there should be no problem.
[25 Oct 2008 16:41] Randolph Lucas
I don't understand the response.  Sounds like it doesn't work with 5.1 either.  I can't find references to SQLInstallDriverExW which is the undefined symbol.  How do I get that symbol reference resolved?  Is this a version thing or configuration thing?  I am running MySQL 5.0.27.  Thanks.
[25 Oct 2008 19:52] Thomas Lee
In your web site, 5.1 is the latest version for Linux. There is no unicode verson for download.
[25 Oct 2008 20:51] Jess Balint
You need to use unixODBC 2.2.12 or higher with MySQL Connector/ODBC 5.1. The Unicode installer API is only available in this version of unixODBC. From the unixODBC 2.2.12 changelog:

 # Add UNICODE wrapper functions in libodbcinst. The ini file is still ascii, so 
 its not got full support at the moment, but any apps that need the W functions
 should build now
[27 Oct 2008 13:43] Thomas Lee
Actually we dont care W function or Unicode and this driver seem to work for
unix odbc not for Linux. We have installed 3.51 driver but got error so I installed higher release hoping to solve the problem. 
This is definitely a bug as a user we dont have the sources to solve it. Please have your developer to look at as soon as you can. Thanks.
[27 Oct 2008 14:03] Tonci Grgin
Thomas, I do not get it... What can be so difficult in understanding "You need to use unixODBC 2.2.12 or higher"?

This is not a bug in MySQL SW.

Thanks for your interest in MySQL.
[27 Oct 2008 22:32] Thomas Lee
I look your web site didnt see any unixOdbc download. Since we use Linux only I decide to use 0ld 3.51 driver. But when I tried to remove 5.01 so I can re-install 3.51 which didnt work for some reason.

[root@mastero2 download]# rpm -iv mysql-connector-odbc-5.1.5-0.i386.rpm
warning: mysql-connector-odbc-5.1.5-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing packages for installation...
        package mysql-connector-odbc-5.1.5-0 is already installed
[root@mastero2 download]# rpm -evv mysql-connector-odbc-5.1.5-0.i386.rpm
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
error: package mysql-connector-odbc-5.1.5-0.i386.rpm is not installed
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
[28 Oct 2008 7:55] Bogdan Degtyariov
Thomas,

UnixODBC is the ODBC Diver Manager (which is not MySQL Software).
The driver manager (unixODBC or iODBC) is required for both versions of Mysql Connectors/ODBC 3.51 and 5.1.

ODBC is the unified API which is supposed to work with any RDBMS that provide ODBC drivers. However, you never load drivers directly. ODBC applications always link the driver manager library and configure data sources in odbc.ini/odbcinst.ini files. This allows you to get data from multiple sources (MySQL Server, Microsoft SQL Server, Oracle, etc) without re-linking your ODBC client application.

Please check the following page with general information about ODBC architecture, drivers and driver managers:

http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-general-information.html

Here you can read more information about unixODBC:

http://www.unixodbc.org/

Thanks.
[28 Oct 2008 13:25] Thomas Lee
Thank you for the updated information.
[29 Oct 2008 19:38] Thomas Lee
After install unixodbc, I  changed to  unixODBC-2.1.12 folder and be able to execute > ./configure
But got some error message at end. The make or make install failed.

checking for ftok... yes
checking for semget... yes
checking for shmget... yes
checking for semop... yes
checking for snprintf... yes
checking for semundo union... yes
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... yes
checking for X... no
configure: checking for Qt
checking for Qt headers... no
configure: error: cannot find correct Qt headers!

[root@mastero2 unixODBC-2.2.12]# make
make: *** No targets specified and no makefile found. Stop.
[root@mastero2 unixODBC-2.2.12]# make install
make: *** No rule to make target `install'. Stop

Then I try to make new source name got same error before,even install unixODBC

[root@mastero2 unixODBC-2.2.12]# myodbc-installer -s -a -c2 -n "test" -t "DRIVER=MySQL ODBC 5.1 Driver;SERVER=localhost;DATABASE=test;UID=root;PWD=system"
myodbc-installer: symbol lookup error: myodbc-installer: undefined symbol: SQLValidDSNW

Do I need install Qt? Where I can get it? Why you dont put bundle files needed
along with your odbc-connector in your web site .
[29 Oct 2008 20:49] Tonci Grgin
Thomas, I do not mean to be rude but three of us helped you on the issue that is definitely not MySQL's fault nor it can be perceived as a bug in MySQL SW.

> Do I need install Qt? Where I can get it? Why you dont put bundle files needed along with your odbc-connector in your web site.

Prior to trying to do something as important as data management on should at least become familiar with concepts (please revisit Bogdan's post). Unfortunately we *can not* bundle anything with our connector. By doing so we would show favouritism towards certain platform/vendor ... limiting your right to choose for yourself. You are *free* to try iODBC or any other ODBC DM there is. Our job is to make c/ODBC as compliant to ODBC standard as possible.

Thanks for your interest in MySQL.
[29 Oct 2008 22:05] Thomas Lee
I dont think you answer my question. I have visited unixodbc.org, where I clicked Qt page, but shown not available page and point me to other link have Qt name, believe it is 3rd party sw with houndreds of MB. But I dont think 
that is the one I need because of huge size.

The question is with that error message so I must get some dependency to eliminate them, therefore the 5.1 connector can work well?

To user, actually we dont care you favor which vendor but we do care your claim some sw work in some system but actually didnt. And it took us so many effort to find missing files without a clue. I think people have reason to doubt your sw may have more problem to come.
[30 Oct 2008 3:41] Bogdan Degtyariov
Thomas,

The QT part is optional, you can skip it if you do not need GUI for configuring drivers and data sources. IMHO editing odbc.ini/odbcinst.ini files manually is always more flexible. So, disabling GUI can be made through --disable-gui configure option as follows:

./configure --disable-gui

or 

./configure --enable-gui=no

Thanks.
[30 Oct 2008 19:06] Thomas Lee
Bogdan, thank you for your help.
After I ran ./configure enable-gui=no ok.
Then >make install, seemed ok as follow

(cd /usr/local/lib && { ln -s -f libboundparam.so.1.0.0 libboundparam.so || { rm -f libboundparam.so && ln -s libboundparam.so.1.0.0 libboundparam.so; }; })
/usr/bin/install -c .libs/libboundparam.lai /usr/local/lib/libboundparam.la
PATH="$PATH:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/usr/download/unixODBC-2.2.12/samples'
make[1]: Leaving directory `/usr/download/unixODBC-2.2.12/samples'
make[1]: Entering directory `/usr/download/unixODBC-2.2.12'
make[2]: Entering directory `/usr/download/unixODBC-2.2.12'
make[2]: Nothing to be done for `install-exec-am'.
touch /usr/local/etc/odbcinst.ini
touch /usr/local/etc/odbc.ini
mkdir -p /usr/local/etc/ODBCDataSources
make[2]: Leaving directory `/usr/download/unixODBC-2.2.12'
make[1]: Leaving directory `/usr/download/unixODBC-2.2.12'

[root@mastero2 unixODBC-2.2.12]# myodbc-installer -s -a -c2 -n "test" -t "DRIVER=MySQL ODBC 5.1 Driver;SERVER=localhost;DATABASE=test;UID=root;PWD=system"
myodbc-installer: symbol lookup error: myodbc-installer: undefined symbol: SQLValidDSNW

still have same error as before.
[4 Nov 2008 17:37] Thomas Lee
Thank you, that is work but I saw some undefined symbol error still came from 
unixodbc which I already installed successfully before

[root@mastero2 download]# rpm -evv mysql-connector-odbc-5.1.5-0
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
D:  read h#    1261 Header SHA1 digest: OK (704027e7d4da744d2e2bd5eecd5a217fe1542350)
D: ========== --- mysql-connector-odbc-5.1.5-0 i386/linux 0x1
D: opening  db index       /var/lib/rpm/Requirename rdonly mode=0x0
D: closed   db index       /var/lib/rpm/Requirename
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages create mode=0x42
D: mounted filesystems:
D:     i    dev bsize       bavail       iavail mount point
D:     0 0xfd00  4096        10390       121730 /
D:     1 0x0003  4096            0           -1 /proc
D:     2 0x0000  4096            0           -1 /sys
D:     3 0x0009  4096            0           -1 /dev/pts
D:     4 0x000e  4096            0           -1 /proc/bus/usb
D:     5 0x0803  1024        80339        26166 /boot
D:     6 0x0010  4096       129127       129126 /dev/shm
D:     7 0xfd01  1024       467867       129431 /tmp
D:     8 0xfd02  4096     27833748     15194779 /usr
D:     9 0xfd03  1024       328121       127749 /var
D:    10 0xfd05  4096      6196837      3335752 /home
D:    11 0x0011  4096            0           -1 /proc/sys/fs/binfmt_misc
D:    12 0x0012  4096            0           -1 /var/lib/nfs/rpc_pipefs
D: sanity checking 1 elements
D: computing 11 file fingerprints
D: computing file dispositions
D: opening  db index       /var/lib/rpm/Basenames create mode=0x42
D: ========== --- mysql-connector-odbc-5.1.5-0 i386-linux 0x1
D:     erase: mysql-connector-odbc-5.1.5-0 has 11 files, test = 0
D: opening  db index       /var/lib/rpm/Name create mode=0x42
D:  read h#    1261 Header SHA1 digest: OK (704027e7d4da744d2e2bd5eecd5a217fe1542350)
D: opening  db index       /var/lib/rpm/Triggername create mode=0x42
D:     erase: %preun(mysql-connector-odbc-5.1.5-0.i386) asynchronous scriptlet start
D:     erase: %preun(mysql-connector-odbc-5.1.5-0.i386) execv(/bin/sh) pid 24185+ myodbc-installer -r -d -n 'MySQL ODBC 5.1 Driver'
myodbc-installer: symbol lookup error: myodbc-installer: undefined symbol: SQLRemoveDriverW
D:     erase: waitpid(24185) rc 24185 status 7f00 secs 0.013
error: %preun(mysql-connector-odbc-5.1.5-0.i386) scriptlet failed, exit status 127
D: closed   db index       /var/lib/rpm/Triggername
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
[root@mastero2 download]#
[4 Nov 2008 17:42] Thomas Lee
Sorry, the previous submit should be put in bug #40405 instead of here.
[6 Nov 2008 20:29] Thomas Lee
After unixodbc installed ok, re-install 5.1 driver still have symbol error as before

[root@mastero2 download]# rpm -iv --force  mysql-connector-odbc-5.1.5-0.i386.rpm
warning: mysql-connector-odbc-5.1.5-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing packages for installation...
mysql-connector-odbc-5.1.5-0
myodbc-installer: symbol lookup error: myodbc-installer: undefined symbol: SQLInstallDriverExW
error: %post(mysql-connector-odbc-5.1.5-0.i386) scriptlet failed, exit status 127
[6 Nov 2008 20:40] Thomas Lee
After unixodbc installed ok, re-install 5.1 driver still have symbol error as before

[root@mastero2 download]# rpm -iv --force  mysql-connector-odbc-5.1.5-0.i386.rpm
warning: mysql-connector-odbc-5.1.5-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing packages for installation...
mysql-connector-odbc-5.1.5-0
myodbc-installer: symbol lookup error: myodbc-installer: undefined symbol: SQLInstallDriverExW
error: %post(mysql-connector-odbc-5.1.5-0.i386) scriptlet failed, exit status 127
[9 Dec 2008 14:12] Thomas Lee
Even the status list as "not a bug" but problem still there, it didnt work
[9 Dec 2008 14:28] Tonci Grgin
Thomas, I understand you have problems, even though not caused by our SW, so I asked a colleague to take a second look and see if he can help you.

Thanks for your interest in MySQL.
[12 May 2009 0:10] Owen Townsend
I have exactly the same problem "undefined symbol SQLInstallDriverExW"
I am running RHEL 5.1 on AMD Opteron 64
I have mysql 5.0 installed & tested OK
I installed unixODBC-2.2.14 OK
NOW, trying to install mysql-connector-odbc-5.1.5.0.x86_64.rpm (May 11/2009)
--- and get same error "undef symbol SQLInstallDriverExW"
--> Has there been a resolution of this problem (since last post December 2008) ?
Hope somebody can help, Thanks
Owen Townsend, owen@uvsoftware.ca
[12 May 2009 6:55] Jess Balint
Owen,
Please verify, using rpm, that you do in fact have unixODBC version 2.2.12 or later. That is the reason for this error message.
[12 May 2009 14:05] Owen Townsend
Thanks Jess Balint for the quick response, BUT I do have unixODBC-2.2.14
downloaded/installed yesterday from www.unixodbc.org
So version is not the reason for the error "undef symbol SQLInstallDriverExW"
Can you think of any other reason ?
Does the 'W' suffix indicate Windows ? or Wide characters ?
Thanks, Owen
[12 May 2009 14:11] Tonci Grgin
Owen, per ODBC specs "W" are unicode functions. I do not know what could be wrong but that this specific function is missing from UnixODBC. Have you tried contacting them?
[12 May 2009 20:54] Owen Townsend
responses above (in bug#40289) said to use unixODBC-2.2.12 +
I am using unixODBC-2.2.14 & still getting undefined SQLInstallDriverExW
when it run rpm -i --force mysql-connector-odbc-5.1.5-0.x86_64.rpm

Other searches sugegsted unixODBC files odbcinst.ini & odbcinst.h might have
something to do with the problem ?
I see there is an /etc/odbsinct.ini file on my system, but the unixODBC install
installed it in a different location /usr/local/etc/odbcinst.ini BUT it is null

/usr/local/include/odbcinst.h <-- was installed by unixODBC install
it defines function SQLInstallDriverEX as:
BOOL INSTAOI SQLInstallDriverEX(LPCSTR lpszDriver, .......)
but at the end I see
#ifdef UNICODE
#define SQLInstallDriverEx SQLInstallDriverExW
BUT function SQLInstallDriverExW was NOT defined ???
Does anyone know the solution here ?

Owen
[18 May 2009 8:45] Tonci Grgin
Owen, have you thought of contacting UnixODBC team? Or trying iODBC?
[20 May 2009 6:47] Tonci Grgin
Bug#44837 was marked as duplicate of this report.
[20 May 2009 14:11] Owen Townsend
I gave up on 5.0=5.1 version & installed the 3.51 mysql-connector-odbc
and that works. With 'isql' I can execute queries on the mysql database.
My Micro Focus COBOL connect does not work, but I think that is a Micro Focus
COBOL problem and I have submitted a bug report to them.
Thanks, Owen
[20 May 2009 15:37] Jess Balint
Owen,
The reason for this is that Connector/ODBC 3.51 has no Unicode support, and therefore does not depend on finding the Unicode installer functions in your old version of unixODBC.
[20 May 2009 22:29] Owen Townsend
I have proven mysql-connector-odbc 3.51 works using 'isql' to query mysql tables.
But my COBOL program conenct gets ERR 'cant open /usr/local/lib/libmyodbc3.so'
which is specified in odbcinst.ini & proven to work with 'isql'

1st I tried libmyodbc3-3.51.27.so (2,209,708 bytes) from /usr/lib64/... from rpm
download/mysql-connector-odbc-3.51.27-0.x86_64.rpm
2nd I tried libmyodbc3-3.51.27.so (4,651,514 bytes) from 
download/mysql-connector-odbc-3.51.27-linux-x86-64bit.tar.gz
- copied to /usr/local/lib/ (vs /usr/lib64/) & odbcinst.ini updated
BUT - I still get driver not found

Micro Focus COBOL say their OpenESQL is 32 bit
Is that a problem with 64 bit drivers from ...x86_64.rpm or ...64bit.tar.gz ?
Is there a mysql connector 32 bit driver that would work on my AMD 64 Opteron ?
- ifso what would the package name be ?
Thanks, Owen
[21 May 2009 16:05] Owen Townsend
May21/09 - testing ODBC connector to MySQL database (using 'isql' & COBOL)
         - see odbc.ini file at www.uvsoftware.ca/sqldemo.htm#6E2
         - see isql test/demo at www.uvsoftware.ca/sqldemo.htm#6F1
- isql worked with 64bit Driver but not COBOL OpenESQL 32 bit
  so I downloaded 32bit Driver & tested as follows:

--> isql myodbc351 <-- gives following ERROR when 32 bit driver spcfd
[ISQL]ERROR: Could not SQLConnect
[01000][unixODBC][Driver Manager]Can't open lib '/usr/local/lib32/libmyodbc3.so'
 : /usr/local/lib32/libmyodbc3.so: wrong ELF class: ELFCLASS32

# 32bit & 64bit Drivers downloaded/extracted from following packages:
mysql-connector-odbc-3.51.27-linux-x86-32bit.tar.gz 
mysql-connector-odbc-3.51.27-linux-x86-64bit.tar.gz

Does this mean I can only hope that Micro Focus COBOL will provide
a 64 bit OpenESQL in the future ?
[21 May 2009 17:18] Jess Balint
You can build a 32-bit library of unixODBC.
[21 May 2009 20:52] Owen Townsend
unixODBC reconfigured 32 bits (but now now get socket error)
---> CFLAGS=-m32 ./configure --disable-gui + make + make install
- Now 32bit isql works, BUT COBOL gets error
"cant connect to local MySQL server thru socket /tmp/mysql.sock"

odbc.ini & odbcinst.ini have --> SOCKET = /var/lib/mysql/mysql.sock 
(a zero length file)
As you see from errmsg it is looking for /tmp/mysql.sock
I set that up as 0 file with all permissions but still get the error ???
You can see my odbc.ini at www.uvsoftware.ca/sqldemo.htm#6E2
BUT we seem to be making progress, hopefully more to come, Thanks, Owen
[22 May 2009 18:49] Owen Townsend
When my odbc.ini file (at www.uvsoftware.ca/sqldemo.htm#6E2 defines SOCKET as:
SOCKET = /var/lib/mysql/mysql.sock
My COBOL connect gets ERROR: cant connect thru socket '/tmp/mysql.sock'

So I change odbc.ini to: SOCKET = /tmp/mysql.sock
Then COBOL still gives same errmsg, And 'isql' gives following errmsg:

[ISQL]ERROR: Could not SQLConnect
[08S01][unixODBC][MySQL][ODBC 3.51 Driver]Can't connect to local MySQL server
through socket '/tmp/mysql.sock' (111)

If I change back to SOCKET = /var/lib/mysql/mysql.sock
then isql works OK, but COBOL does not work either way 
Hope somebody can tell me how to fix this ???
Thanks, Owen
[24 May 2009 1:20] Owen Townsend
Hurah - I have my COBOL program working acessing MySQL tables via ODBC
Thank You to Jes Balint, who provided some helpful tips
And Thanks to Micro Focus COBOL with some helpful tips
Problem#1 was COBOL ESQL is 32 bit but 1st drivers I tried were 64 bit
- solved by changing Driver Manager (unixODBC.org) to 32 bit
- and changing Driver (mysql-connector-odbc) to 32 bit
Problem#2 was I got unable to connect thru socket /tmp/mysql.sock
- because COBOL was using /tmp/mysql.sock, but MySQL /var/lib/mysql/mysql.sock
- solved by setup /etc/my.cnf with socket = /tmp/mysql.sock
See demo COBOL OpenESQL --> ODBC --> MySQL www.uvsoftware.ca/sqldemo.htm#Part_6
Thanks Owen