in reply to Re: DBD::MySQL Install Problem
in thread DBD::MySQL Install Problem

I had already downloaded DBD-mysql-4.005 from CPAN and it failed complaining about it could not find mysql_config file.

However I tried again but this time I put the mysql_config from the mysql source directory into the DBD-mysql-4.005 directory.

Running perl Makefile.PL produces the following:

I will use the following settings for compiling and testing:

cflags (mysql_config) = -I/usr/local/mysql/include/mysql
embedded (mysql_config) =
libs (mysql_config) =
-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lposix4 -lresolv -lgen -lsocket -lnsl -lm
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testsocket (default ) =
testuser (default ) =

To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'.

Using DBI 1.58 (for perl 5.008008 on i86pc-solaris) installed in /usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI/ Writing Makefile for DBD::mysql

I then ran make which produced the following:

gcc -c -I/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI -I/usr/local/mysql/include/mysql -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -O -DVERSION=\"4.005\" -DXS_VERSION=\"4.005\" -fPIC "-I/usr/local/lib/perl5/5.8.8/i86pc-solaris/CORE" dbdimp.c gcc -c -I/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBI -I/usr/local/mysql/include/mysql -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -DPERL_USE_SAFE_PUTENV -O -DVERSION=\"4.005\" -DXS_VERSION=\"4.005\" -fPIC "-I/usr/local/lib/perl5/5.8.8/i86pc-solaris/CORE" mysql.c

Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/local/mysql/lib/mysql:/usr/lib" /usr/local/bin/perl myld gcc -G dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so \ -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lposix4 -lresolv -lgen -lsocket -lnsl -lm \
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/DBD::mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/Bundle::DBD::mysql.3

I then ran make install

Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBD/mysql/.packlist
Appending installation info to /usr/local/lib/perl5/5.8.8/i86pc-solaris/perllocal.pod

So I thought things were going well until I ran a test script that uses DBI which produced the following error:

install_driver(mysql) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: libmysqlclient.so.15: open failed: No such file or directory at /usr/local/lib/perl5/5.8.8/i86pc-solaris/DynaLoader.pm line 230.

at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at test.pl line 7
It looks like it can't load / find the libs.

I am running out of steam and getting very frustraded with myself. I hope that you can provide solution so that I can get past the install and start having some fun with it.

Replies are listed 'Best First'.
Re^3: DBD::MySQL Install Problem
by Joost (Canon) on Aug 22, 2007 at 16:53 UTC
    Unless you've specifically build mysql without the client libraries that would probably work.

    But maybe the mysql_config program you've provided does not point to the right locations. (by the way, installing mysql should install mysql_config, that directory might not be in your path - it could be installed in /usr/sbin or /usr/local/bin for instance)

    what does

    mysql_config --libs
    print?

    Mine (on linux) gives

    -L/usr/lib/mysql -lmysqlclient
    Which means that libmysqlclient.so* should be installed in /usr/lib/mysql. Which is correct for my system.

      The pre-build does not fix the problem with the DBD:Mysql.

      However just as I was about to throw the machine out in to the rain I was able to get DBI to work. ( At least at first glance. )

      In my MySQL libs I had three instances of libmysqlclient.

      libmysqlclient.so.15.0.0
      libmysqlclient.so.15
      libmysqlclient.so

      .so.15 and .so were links to libmysqlclient.so.15.0.0 so I removed them.

      I then ran make again on DBD-mysql-4.005 and then make install. I then recreated the links I had removed.

      I then ran the test.pl which seemed to work as it gave me a good error : )

      DBI connect('database=test;host=localhost','joe',...) failed: Access denied for user 'joe'@'localhost' (using password: YES) at test.pl line 7

      I will run more tests today and then report back if there are any other problems.

Re^3: DBD::MySQL Install Problem
by clinton (Priest) on Aug 22, 2007 at 16:20 UTC
    install_driver(mysql) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.8/i86pc-solaris/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: libmysqlclient.so.15: open failed: No such file or directory at /usr/local/lib/perl5/5.8.8/i86pc-solaris/DynaLoader.pm line 230.
    You need to install the MySQL client libraries, which you can find here: MySQL downloads

    Just reread your thread, where you said that you'd compiled MySQL from source, in which case you should already have the client libraries. So ignore the above. What about trying the MySQL prebuilt packages instead?

    Clint

      The pre-build does not fix the problem with the DBD:Mysql.

      However just as I was about to throw the machine out in to the rain I was able to get DBI to work. ( At least at first glance. )

      In my MySQL libs I had three instances of libmysqlclient.

      libmysqlclient.so.15.0.0
      libmysqlclient.so.15
      libmysqlclient.so

      .so.15 and .so were links to libmysqlclient.so.15.0.0 so I removed them.

      I then ran make again on DBD-mysql-4.005 and then make install.

      I then ran the test.pl which seemed to work as it gave me a good error : )

      DBI connect('database=test;host=localhost','joe',...) failed: Access denied for user 'joe'@'localhost' (using password: YES) at test.pl line 7

      I will run more tests today and then report back if there are any other problems.