1

I've updated mysql (client+server+dev) from the rpms available on mysql.com.

rpm -i MySQL-server-5.5.14-1.linux2.6.x86_64.rpm
rpm -i MySQL-client-5.5.14-1.linux2.6.x86_64.rpm
rpm -i MySQL-devel-5.5.14-1.linux2.6.x86_64.rpm

now, a script that used to connect to another server says:

perl: symbol lookup error: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so: undefined symbol: mysql_init

the script:

use DBI;

$dsn="db";
$host="my.host.ip";
$user="anonymous"; 
$password="";
# Connect to the database.
 $dbh= DBI->connect("DBI:mysql:host=$host;database=$dsn",$user, $password,{'RaiseError' => 1});

So, I've reinstalled DBI-1.616 and DBD-mysql-4.019 from the sources. for DBD-mysql, Make test says:

$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base....................ok 1/6                                           
#   Failed test 'use DBD::mysql;'
#   in t/00base.t at line 21.
#     Tried to use 'DBD::mysql'.
#     Error:  Can't load '/usr/local/package/DBD-mysql-4.019/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: /usr/local/package/DBD-mysql-4.019/blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: mysql_get_server_version at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
#  at (eval 6) line 2
# Compilation failed in require at (eval 6) line 2.
# BEGIN failed--compilation aborted at t/00base.t line 21.
t/00base....................NOK 2FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9

How can I fix this problem ?

Thanks !

Pierre
  • 429
  • 1
  • 5
  • 14

2 Answers2

1

OK, I've got the solution. As far as I understand, the mysql distribution I used is statically linked. So when DB:mysql is installed, it needs to be compiled with those static libraries:

  mkdir /tmp/mysql-static
  cp /usr/lib64/mysql/*.a /tmp/mysql-static
  perl Makefile.PL --libs="-L/tmp/mysql-static -lmysqlclient"
  make
  make test
  make install
  rm -rf /tmp/mysql-static
Pierre
  • 429
  • 1
  • 5
  • 14
0

The fact that DBD-mysql now can't find the symbol mysql_get_server_version suggests that the newer MySQL client library you've installed probably lacks that particular function (or has renamed it, or something). Given that you don't provide information on what you upgraded to, or from, it's difficult to investigate and give you the full answer handed to you on a plate, but I'd be inclined to try a DBD-mysql upgrade, on the basis that a non-backwards-compatible API change may be involved, and a newer DBD-mysql version might handle it better.

womble
  • 96,255
  • 29
  • 175
  • 230