databases/p5-DBD-mysql

Geffy

Verified User
Joined
Aug 24, 2004
Messages
82
I am trying to figure out the best way of installing the databases/p5-DBD-mysql port for FreeBSD 4.9. Everytime I go to build it it of course attempts to build the mysql client (v4.0.20) because DirectAdmin puts the MySQL stuff in a non-standard place wrt FreeBSD.
I tried building the module not using the port, but that fails with something regarding a structure not having a 'mysql' var or something to that effect

If I do build the port (and dependencies) will it somehow screwup the DirectAdmin MySQL installation, and will the MySQL Client at v4.0.20 still be able to talk to the DirectAdmin MySQL which I think is 4.0.17 according to the pathname in /usr/local
 

BigWil

Verified User
Joined
Aug 5, 2004
Messages
313
Ok. Well I am done studying those other threads and frankly they aren't solving the problems that seem to be FreeBSD related. So lets start with some FreeBSD user feedback.

I tried the CPAN and the Wget methods explained in the other threads. Both seem to have the same outcomes. DBI installs ok but DBD does not.

CPAN is the easiest so I will use that here:
cpan> install Bundle::DBD::mysql
(this will fail miserably)

First of course the install of mysql_config isn't anywhere near being in the path. Fixed that by finding where the DA version of MySQL puts it. Created a symbolic link so that the makefile can find it.

(single line below)
ln -s /usr/local/mysql-standard-4.0.17-unknown-freebsd4.7-i386/bin/mysql_config /usr/local/mysql_config
rehash

Now I head on over to where CPAN tried to run its install from:
cd /root/.cpan/build/DBD-mysql-2.9004

Now I try the install again after cleaning up:
perl Makefile.PL

Seems to find everything ok but then the bomb hits:

Use of uninitialized value in string ne at /usr/local/lib/perl5/5.8.2/BSDPAN/ExtUtils/MM_Unix.pm line 44.
Note (probably harmless): No library found for -lmysqlclient
Using DBI 1.38 installed in /usr/local/lib/perl5/site_perl/5.8.2/mach/auto/DBI
Writing Makefile for DBD::mysql


So can anybody figure out why it isn't finding the mysqlclient library? I have searched the system high and low and guess what.... I can't find it either. Assuming it is looking for libmysqlclient.so of course. libmysqlclient.a is in there but I don't think it is wanting to use it.

It says (probably harmless) but I have never heard of a DBD install working without the database library files.

Big Wil
 

Geffy

Verified User
Joined
Aug 24, 2004
Messages
82
the lack of the libmysqlclient.so file is the main block I came up against as well. I installed the DBI from the ports and then tried to build the DBD-mysql from the tar.gz and it couldnt find the libmysqlclient.so

Have recently been wondering if it would be possible to build the MySQL stuff from the FreeBSD ports, and then if possible edit some of the directadmin.conf file settings to use the MySQL port version. The downside is that I am not completely sure that DirectAdmin will like the Port version as its more recent than the one its using right now, and I cant really play too much as its on a currently live server
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
8,990
Hello,

Check /usr/local/mysql/lib/libmysqlclient.so

You may need to try the following:

ln -s /usr/local/mysql/lib /usr/local/lib/mysql
ln -s /usr/local/mysql/include /usr/local/include/mysql

John
 

BigWil

Verified User
Joined
Aug 5, 2004
Messages
313
John,

As stated in the above.... libmysqlclient.so is not on the file system anywhere. I believe it is not being included with your MySQL Binary. This in itself will cause the DBD install to fail.

hera# /usr/libexec/locate.updatedb
hera# locate libmysqlclient.so
hera#

Nothing.... I have gone out to the normal library areas and looked for it but still find it nowhere.

Big Wil
 

Geffy

Verified User
Joined
Aug 24, 2004
Messages
82
thnx I will go and see if I can wget it into the right place
 

Geffy

Verified User
Joined
Aug 24, 2004
Messages
82
just tried and once again I got this

# pwd
/usr/ports/databases/p5-DBD-mysql
# make install
===> Vulnerability check disabled
>> DBD-mysql-2.9004.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
>> Attempting to fetch from http://www.cpan.dk/CPAN/modules/by-module/DBD/.
Receiving DBD-mysql-2.9004.tar.gz (114043 bytes): 100%
114043 bytes transferred in 0.2 seconds (700.04 kBps)
===> Extracting for p5-DBD-mysql-2.9004
>> Checksum OK for DBD-mysql-2.9004.tar.gz.
===> p5-DBD-mysql-2.9004 depends on file: /usr/local/bin/perl5.8.0 - found
===> Patching for p5-DBD-mysql-2.9004
===> p5-DBD-mysql-2.9004 depends on file: /usr/local/bin/perl5.8.0 - found
===> p5-DBD-mysql-2.9004 depends on file: /usr/local/lib/perl5/site_perl/5.8.0/mach/DBI.pm - found
===> p5-DBD-mysql-2.9004 depends on file: /usr/local/bin/perl5.8.0 - found
===> p5-DBD-mysql-2.9004 depends on shared library: mysqlclient.12 - not found
===> Verifying install for mysqlclient.12 in /usr/ports/databases/mysql40-client
===> Vulnerability check disabled
===> Extracting for mysql-client-4.0.20
>> Checksum mismatch for mysql-4.0.20.tar.gz.
===> Refetch for 1 more times files: mysql-4.0.20.tar.gz
===> Vulnerability check disabled
>> mysql-4.0.20.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
>> Attempting to fetch from ftp://planetmirror.com/pub/mysql/Downloads/MySQL-4.0/.
^Cfetch: transfer interrupted

#
So its still trying to get mysql-client installed as part of the process

BTW I put the libmysqlclient.so into
/usr/local/mysql/lib and then symlinked as shown above
 
Last edited:

Geffy

Verified User
Joined
Aug 24, 2004
Messages
82
Sorry for the thread view, but can someone help me get this working.
This is from trying to do it manually. As far as I can tell its picking up the right paths for the include and libs as they were symlinked as per the directions above

perl Makefile.PL
Code:
# /usr/bin/perl Makefile.PL --testdb=geffy_test --testuser=geffy_test --testpassword=testing --testhost=localhost
I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/local/include/mysql -DHAVE_BROKEN_REALPATH
  libs          (mysql_config) = -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (Users choice) = geffy_test
  testhost      (Users choice) = localhost
  testpassword  (Users choice) = testing
  testuser      (Users choice) = geffy_test

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

Checking if your kit is complete...
Looks good
Using DBI 1.42 (for perl 5.008 on i386-freebsd) installed in /usr/local/lib/perl5/site_perl/5.8.0/mach/auto/DBI
Writing Makefile for DBD::mysql
make
Code:
# make
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Mysql.pm blib/lib/Mysql.pm
cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -c  -I/usr/local/lib/perl5/site_perl/5.8.0/mach/auto/DBI -I/usr/local/include/mysql -DHAVE_BROKEN_REALPATH  -DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.0/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include -O -pipe    -DVERSION=\"2.9004\"  -DXS_VERSION=\"2.9004\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.8.0/mach/CORE"   dbdimp.c
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/local/lib/perl5/site_perl/5.8.0/mach/auto/DBI/Driver.xst > mysql.xsi
/usr/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp  -typemap /usr/local/lib/perl5/5.8.0/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 196
Warning: duplicate function definition 'rows' detected in mysql.xs, line 294
cc -c  -I/usr/local/lib/perl5/site_perl/5.8.0/mach/auto/DBI -I/usr/local/include/mysql -DHAVE_BROKEN_REALPATH  -DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.0/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include -O -pipe    -DVERSION=\"2.9004\"  -DXS_VERSION=\"2.9004\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.8.0/mach/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/lib/mysql:/usr/lib" /usr/bin/perl myld cc  -shared  -L/usr/local/lib dbdimp.o  mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so   -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -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/Mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/Bundle::DBD::mysql.3
make test
Code:
# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base...........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/00base.t line 38
t/00base...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 4-5
        Failed 2/5 tests, 60.00% okay
t/10dsnlist........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/10dsnlist.t line 45
t/10dsnlist........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-3
        Failed 3/3 tests, 0.00% okay
t/20createdrop.....install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/20createdrop.t line 45
t/20createdrop.....dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-5
        Failed 5/5 tests, 0.00% okay
t/30insertfetch....install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/30insertfetch.t line 48
t/30insertfetch....dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
        Failed 11/11 tests, 0.00% okay
t/40bindparam......install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 at (eval 5) line 3
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at t/40bindparam.t line 64
t/40bindparam......dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-28
        Failed 28/28 tests, 0.00% okay
t/40blobs..........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/40blobs.t line 68
t/40blobs..........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
        Failed 11/11 tests, 0.00% okay
t/40listfields.....install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/40listfields.t line 57
t/40listfields.....dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-18
        Failed 18/18 tests, 0.00% okay
t/40nulls..........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/40nulls.t line 50
t/40nulls..........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-11
        Failed 11/11 tests, 0.00% okay
t/40numrows........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/40numrows.t line 59
t/40numrows........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-25
        Failed 25/25 tests, 0.00% okay
t/50chopblanks.....install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/50chopblanks.t line 57
t/50chopblanks.....dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-35
        Failed 35/35 tests, 0.00% okay
t/50commit.........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/50commit.t line 64
t/50commit.........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-30
        Failed 30/30 tests, 0.00% okay
t/60leaks..........skipped
        all skipped: $ENV{SLOW_TESTS} is not set or Proc::ProcessTable not installed
t/ak-dbd...........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/ak-dbd.t line 59
t/ak-dbd...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-90
        Failed 90/90 tests, 0.00% okay
t/akmisc...........Had to create DBD::mysql::dr::imp_data_size unexpectedly at /usr/local/lib/perl5/site_perl/5.8.0/mach/DBI.pm line 1061.
Can't locate object method "connect" via package "Mysql" at /root/perl/DBD/mysql/DBD-mysql-2.9004/blib/lib/Mysql.pm line 71.
t/akmisc...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-351
        Failed 351/351 tests, 0.00% okay
t/dbdadmin.........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/dbdadmin.t line 74
t/dbdadmin.........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-21
        Failed 21/21 tests, 0.00% okay
t/insertid.........install_driver(mysql) failed: Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 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 t/insertid.t line 13
t/insertid.........dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-12
        Failed 12/12 tests, 0.00% okay
t/mysql............Can't load '/root/perl/DBD/mysql/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/mach/DynaLoader.pm line 229.
 at /root/perl/DBD/mysql/DBD-mysql-2.9004/blib/lib/Mysql.pm line 13
Compilation failed in require at /root/perl/DBD/mysql/DBD-mysql-2.9004/blib/lib/Mysql.pm line 13.
Compilation failed in require at t/mysql.t line 34.
BEGIN failed--compilation aborted at t/mysql.t line 34.
t/mysql............dubious
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-68
        Failed 68/68 tests, 0.00% okay
t/mysql2...........Had to create DBD::mysql::dr::imp_data_size unexpectedly at /usr/local/lib/perl5/site_perl/5.8.0/mach/DBI.pm line 1061.
Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/5.8.0/mach/DBI.pm line 1061.
Can't locate object method "connect" via package "Mysql" at /root/perl/DBD/mysql/DBD-mysql-2.9004/blib/lib/Mysql.pm line 71.
t/mysql2...........dubious
        Test returned status 255 (wstat 65280, 0xff00)
Failed Test       Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/00base.t         255 65280     5    2  40.00%  4-5
t/10dsnlist.t      255 65280     3    3 100.00%  1-3
t/20createdrop.t   255 65280     5    5 100.00%  1-5
t/30insertfetch.t  255 65280    11   11 100.00%  1-11
t/40bindparam.t    255 65280    28   28 100.00%  1-28
t/40blobs.t        255 65280    11   11 100.00%  1-11
t/40listfields.t   255 65280    18   18 100.00%  1-18
t/40nulls.t        255 65280    11   11 100.00%  1-11
t/40numrows.t      255 65280    25   25 100.00%  1-25
t/50chopblanks.t   255 65280    35   35 100.00%  1-35
t/50commit.t       255 65280    30   30 100.00%  1-30
t/ak-dbd.t         255 65280    90   90 100.00%  1-90
t/akmisc.t         255 65280   351  351 100.00%  1-351
t/dbdadmin.t       255 65280    21   21 100.00%  1-21
t/insertid.t       255 65280    12   12 100.00%  1-12
t/mysql.t          255 65280    68   68 100.00%  1-68
t/mysql2.t         255 65280    ??   ??       %  ??
1 test skipped.
Failed 17/18 test scripts, 5.56% okay. 721/724 subtests failed, 0.41% okay.
*** Error code 2

Stop in /root/perl/DBD/mysql/DBD-mysql-2.9004.
 

Geffy

Verified User
Joined
Aug 24, 2004
Messages
82
DirectAdmin Support said:
Hello,

Check /usr/local/mysql/lib/libmysqlclient.so

You may need to try the following:

ln -s /usr/local/mysql/lib /usr/local/lib/mysql
ln -s /usr/local/mysql/include /usr/local/include/mysql

John
just tried something, did
ldconfig -m /usr/local/lib/mysql/

it appears to be working now
 

BigWil

Verified User
Joined
Aug 5, 2004
Messages
313
What did you use to test it to make sure it all installed correctly. After all these troubles I am a skeptic.

BigWil
 
Top