Hi All,

I have set up a new machine (to replace a crusty old server) but I am 
having a few problems installing DBD::mysql which I need for a few apps 
on the box.  I installed MySQL 3.23.52 in /usr/local/mysql, not 
/usr/local and this seemed to cause CPAN to fail when installing 
DBD::mysql so I tried installing it manually.  Here is what I did.

# cd /root/.cpan/sources/authors/id/J/JW/JWIED/DBD-mysql-2.1019

The values for --cflags and --libs in the next step were taken from 
using the commands:

# /usr/local/mysql/bin/mysql_config --cflags
# /usr/local/mysql/bin/mysql_config --libs

Now I ran the command:

# perl Makefile.PL --cflags=-I/usr/local/mysql/include/mysql 
--libs=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm

which produced the following output:

--------------------------------------------------------
Unknown option: lmysqlclient
Unknown option: lz
Unknown option: lcrypt
Unknown option: lnsl
Unknown option: lm
Can't exec "mysql_config": No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
Can't exec "mysql_config": No such file or directory at Makefile.PL line 
169.
readline() on closed filehandle PIPE at Makefile.PL line 171.
I will use the following settings for compiling and testing:

   cflags        (Users choice) = -I/usr/local/mysql/include/mysql
   libs          (Users choice) = -L/usr/local/mysql/lib/mysql
   nocatchstderr (default     ) = 0
   ssl           (guessed     ) = 0
   testdb        (default     ) = test
   testhost      (default     ) =
   testpassword  (default     ) =
   testuser      (default     ) =

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

Checking if your kit is complete...
Looks good
Using DBI 1.30 installed in 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBI
Writing Makefile for DBD::mysql
--------------------------------------------------------

Then a make and make install:

--------------------------------------------------------
# make
cc -c  -I/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBI 
-I/usr/local/mysql/include/mysql -fno-strict-aliasing 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 
-DVERSION=\"2.1019\" -DXS_VERSION=\"2.1019\" -fpic 
"-I/usr/local/lib/perl5/5.8.0/i686-linux/CORE"   dbdimp.c
cc -c  -I/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBI 
-I/usr/local/mysql/include/mysql -fno-strict-aliasing 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 
-DVERSION=\"2.1019\" -DXS_VERSION=\"2.1019\" -fpic 
"-I/usr/local/lib/perl5/5.8.0/i686-linux/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/bin/perl myld cc  -shared -L/usr/local/lib 
dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so
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/Mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/DBD::mysql.3
Manifying blib/man3/Bundle::DBD::mysql.3

--------------------------------------------------------

# 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.0/i686-linux/auto/DBD/mysql/.packlist
Appending installation info to 
/usr/local/lib/perl5/5.8.0/i686-linux/perllocal.pod
--------------------------------------------------------

Now when I run a program that uses DBD::mysql I get the error:

/usr/bin/perl: error while loading shared libraries: 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/mysql/mysql.so: 
undefined symbol: mysql_init

and I am completely stumped, what have I done wrong here?  Is this an 
installation problem, or a problem with the versions of MySQL and 
DYD::mysql I am using?

TIA,
Will.


Reply via email to