Bug #48909 Unable to connect to mysql server
Submitted: 19 Nov 2009 14:58 Modified: 24 Dec 2009 15:38
Reporter: Balakrishna Pandaraboina Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S2 (Serious)
Version:4.010 OS:Linux (2.6.9-67.ELsmp)
Assigned to: CPU Architecture:Any

[19 Nov 2009 14:58] Balakrishna Pandaraboina
Description:
While connecting mysql server I am getting below error

############
"Error : ""install_driver(mysql) faild: Can't load '/apps/tools/ids/ids/ipdb/perl/perllib/arch/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.14: cannot open shared object file: No Such file or directory at /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/DynaLoader.pm lin 230. 
at (eval 8) line 3\nCompilation failed in require at (eval 8) line 3. 
Perhaps a required shared library or d11 isn't installed where expected
at /apps/tools/ids/ids/tools/ipdb/perl/check_modules.pl line 23"
###########
This issue is not repeating in all machine. Only in some machines of Linux only this error is coming.

How to repeat:
#!/usr/bin/perl

use DBI;
my$dbh=DBI->connect("dbi:mysql:dbname:host_server:port","user",'password",{ RaiseError => 1, AutoCommit => 0});
$dbh->disconnect;

Suggested fix:
It will be good if we fix this error with existing DBD::mysql version.
[19 Nov 2009 15:11] Valeriy Kravchuk
Thank you for the problem report. Please, send the results of:

find / -name  "libmysqlclient.so.*" -print 2>/dev/null

from problematic Linux machine(s).
[20 Nov 2009 5:07] Balakrishna Pandaraboina
/usr/lib/mysql/libmysqlclient.so.10
/usr/lib/mysql/libmysqlclient.so.10.0.0
/usr/lib/mysql/libmysqlclient.so.14.0.0
/usr/lib/mysql/libmysqlclient.so.14
[20 Nov 2009 5:43] Alexey Kishkin
OK, could you please also provide here output of:

ldd /apps/tools/ids/ids/ipdb/perl/perllib/arch/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so

and

rpm -qf /usr/lib/mysql/libmysqlclient.so.14.0.0

(I assume you use RHEL, according to kernel version)
[20 Nov 2009 5:47] Alexey Kishkin
oops, wrong format. ldd and file name must be in one row
[20 Nov 2009 6:01] Balakrishna Pandaraboina
1) ldd output:

     libmysqlclient.so.14 => not found
     libz.so.1 => /usr/lib64/libz.so.1 (0x0000002a9569b000)
     libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000002a957ae000)
     libnsl.so.1 => /lib64/libnsl.so.1 (0x0000002a958e3000)
     libm.so.6 => /lib64/tls/libm.so.6 (0x0000002a959fb000)
     libssl.so.4 => /lib64/libssl.so.4 (0x0000002a95b81000)
     libcrypto.so.4 => /lib64/libcrypto.so.4 (0x0000002a95cbe000)
     libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a95eef000)
     libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x0000002a96124000)
     libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x0000002a9623b000)
     libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000002a963ac000)
     libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x0000002a964ae000)
     libresolv.so.2 => /lib64/libresolv.so.2 (0x0000002a965d2000)
     libdl.so.2 => /lib64/libdl.so.2 (0x0000002a966e7000)
     /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)

2)rpm -qf /usr/lib/mysql/libmysqlclient.so.14.0.0 output :
mysql-4.1.20-2.RHEL4.1.0.1
[20 Nov 2009 6:04] Balakrishna Pandaraboina
I have sent the output of "ldd <filename>".
[20 Nov 2009 6:57] Sveta Smirnova
Thank you for the feedback.

Please try to add /usr/lib/mysql to LD_LIBRARY_PATH, then try to run program using DBD::mysql again
[20 Nov 2009 8:51] Balakrishna Pandaraboina
Added "/usr/bin/mysql" to LD_LIBRARY_PATH and tested. No change in results. Same error message is coming.
[20 Nov 2009 11:29] Valeriy Kravchuk
/usr/lib/mysql, NOT /usr/bin/mysql, please! Send the results of:

env | grep LD_LIBRARY_PATH

to confirm.
[20 Nov 2009 11:52] Balakrishna Pandaraboina
I have added "/usr/lib/mysql". No change in results.

output of "env | grep LD_LIBRARY_PATH" :
LD_LIBRARY_PATH=/apps/tools/mmsim/mmsim7.11.205_linux/tools/lib:/apps/tools/ius/ius08.20.012_linux/tools/lib:/apps/tools/cds/ic5141_isr500.6.137_linux/tools/lib:/apps/tools/ipms/current/lib/arch/linux:/usr/share/lib:/usr/lib:/usr/local/lib:/usr/lib/mysql
[20 Nov 2009 12:58] Valeriy Kravchuk
Please, send the results of the same ldd command for .../mysql.so library from the environment where LD_LIBRARY_PATH is set. Also, please, send the results of:

ls -l /usr/lib/mysql/libmysqlclient*
[21 Nov 2009 6:33] Balakrishna Pandaraboina
No change in ldd <filename> output which was taken from terminal with LD_LIBRARY_PATH set to "/usr/lib/mysql"
 
output of "ls -l /usr/lib/mysql/libmysqlclient*":
lrwxrwxrwx  1 root root      26 Jun  6  2006 /usr/lib/mysql/libmysqlclient_r.so.10 -> libmysqlclient_r.so.10.0.0*
-rwxr-xr-x  1 root root  211004 Nov 23  2004 /usr/lib/mysql/libmysqlclient_r.so.10.0.0*
lrwxrwxrwx  1 root root      26 Mar 10  2009 /usr/lib/mysql/libmysqlclient_r.so.14 -> libmysqlclient_r.so.14.0.0*
-rwxr-xr-x  1 root root 1261164 Aug 28  2007 /usr/lib/mysql/libmysqlclient_r.so.14.0.0*
lrwxrwxrwx  1 root root      24 Jun  6  2006 /usr/lib/mysql/libmysqlclient.so.10 -> libmysqlclient.so.10.0.0*
-rwxr-xr-x  1 root root  207520 Nov 23  2004 /usr/lib/mysql/libmysqlclient.so.10.0.0*
lrwxrwxrwx  1 root root      24 Mar 10  2009 /usr/lib/mysql/libmysqlclient.so.14 -> libmysqlclient.so.14.0.0*
-rwxr-xr-x  1 root root 1257220 Aug 28  2007 /usr/lib/mysql/libmysqlclient.so.14.0.0*

Please try to fix this ASAP.
[21 Nov 2009 10:20] Valeriy Kravchuk
Please, send the results of:

file /usr/lib/mysql/libmysqlclient.so.14.0.0
[24 Nov 2009 8:55] Balakrishna Pandaraboina
Result of "file /usr/lib/mysql/libmysqlclient.so.14.0.0" :
/usr/lib/mysql/libmysqlclient.so.14.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
[24 Nov 2009 10:09] Sveta Smirnova
Thank you for the feedback.

ldd output says:

> Result of "file /usr/lib/mysql/libmysqlclient.so.14.0.0" :
> /usr/lib/mysql/libmysqlclient.so.14.0.0: ELF 32-bit LSB shared object, Intel 80386,
> version 1 (SYSV), stripped

while other libraries which you have are 64-bit. Please install 64-bit version of libmysqlclient and check if this solves the problem.
[24 Nov 2009 11:39] Balakrishna Pandaraboina
All Linux machines (including working machines) output of 
"file /usr/lib/mysql/libmysqlclient.so.14.0.0" was same.
I think there will be some other problem other than version mismatch. Please look into this issue. Meanwhile I will try with 64bit client version of mysql.

Thanks,
Balakrishna
[24 Nov 2009 15:38] Valeriy Kravchuk
Please, check if installing missing 64-bit libmyslclient.so.* libraries solves the problem.
[25 Dec 2009 0: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".