Problem Loading DBD::mysql Module (Solaris 9, Perl5.8.5)

Ok the system is Solaris 9. I have installe mysql at /usr/local/mysql/. I have complied and installed my own version of perl (to get arround complier issues when trying to install DBI, since sun's version of perl is complied with Forte (i believe) i couldnt complie DBI with gcc.) located at /usr/local/bin/perl this was compiled with gcc, i have also complied and installed the DBI using my local version of perl. I then installed DBD::mysql by downloading the source and installing using the mysql_config file, all the locations to the libs looked good.

Now when i try to run my perl script (verified to work on another system) that is trying to load the mysql driver i get the following error:

# /usr/local/fax/bin/c_faxsend
install_driver(mysql) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal: libmysqlclient.so.12: open failed: No such file or directory at /usr/local/lib/perl5/5.8.5/sun4-solaris/DynaLoader.pm line 230.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at /usr/local/fax/bin/c_faxsend line 27


i have checked the location of all the libs and files and they all look good (to me) i have also googled about 100 times, and havnt come up with anything.

any tips or resources would be greatly appreciated, as i need to get this server back up asap

Daniel
Daniel@ossms.com
dwodorisioAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rugdogCommented:
so i assume libmysqlclient.so.12 is in /usr/local/mysql/lib, you could probably set the env variable

LD_LIBRARY_PATH="/usr/local/mysql/lib"

0
dwodorisioAuthor Commented:
No, it is at /usr/local/mysql/lib/mysql. thats where i was figuring it was going to look for it since the mysql_conifig was written like this:
LIBS => q[-L/usr/local/lib -R/usr/local/lib -R/usr/lib -L/usr/lib -R/usr/openwin/lib -L/usr/openwin/lib -L/usr/local/ssl/lib -R/usr/local/ssl/lib -L/usr/local/BerkeleyDB.4.2/lib -R/usr/local/BerkeleyDB.4.2/lib -L/usr/local/mysql/lib/mysql -lmysqlclient -lposix4 -lcrypt -lgen -lsocket -lnsl -lm]

i will try to change the env  var.

thanks
/d
0
dwodorisioAuthor Commented:
Ok, after some testing still no luck.

i tried setting the path

# LD_LIBRARY_PATH=/usr/local/mysql/lib
# export LD_LIBRARY_PATH
# /usr/local/fax/bin/c_faxsend
install_driver(mysql) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal: libmysqlclient.so.12: open failed: No such file or directory at /usr/local/lib/perl5/5.8.5/sun4-solaris/DynaLoader.pm line 230.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at /usr/local/fax/bin/c_faxsend line 27
# echo $LD_LIBRARY_PATH
/usr/local/mysql/lib
#

and that didnot work.

i also tried to create a symbolic link to the file libmysqlclient.so.12 in the directory /usr/local/mysql/lib
# pwd
/usr/local/mysql/lib
#
# ls -l
total 4
lrwxrwxrwx   1 root     other         47 Nov 15 21:16 libmysqlclient.so.12 -> usr/local/mysql/lib/mysql/libmysqlclient.so.12
drwxr-xr-x   2 root     mysql        512 Nov 15 10:00 mysql
#


that also didnt work. im still searching on google, and cant seem to find anything. this is buggin me (no pun intended)

/d
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

dwodorisioAuthor Commented:
amemmendment to previous post.  when i create the symbolic link i get a different error message it is this:


Can't use an undefined value as a HASH reference at /usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/DBD/mysql.pm line 113.
0
rugdogCommented:
so when you installed DBD::mysql, and built it, nothing went wrong? i mean, did you "make test"?  can you post the code of c_faxsend?
0
dwodorisioAuthor Commented:
yep, nothing went wrong... that i saw errors for. i did make test on all of them.

the c_faxsend code worked on another system. im wondering if i should take off the DBD and install an older version, i just noticed that i have the dev release on rather then the stable release.
0
dwodorisioAuthor Commented:
**********CODE************
This is the DB portion of the code.

use DBI;


$drh = DBI->install_driver('mysql') || die $DBI::errstr;

$dbh = $drh->connect('fax','fax','pfax') || die $DBI::errstr;



$sth = $dbh->prepare("select Filename,Create_ts,Faxnumber,SequenceId,
                      FaxType from fax where state=0 ");
$sth->execute();

    while(($filename,$ts,$faxn,$id,$ftype) = $sth->fetchrow_array)
    {
# setup the flusend command... and execute. We then need to create a
# new transaction record and update the fax record.

        $faxcmd = "$FAXSEND -o /dev/null -e $FLUACCOUNT -p $FLUPASSWD -r $faxn:$
id -f $filename:application/ms-word";

#       print $faxcmd."\n";
0
rugdogCommented:
when you see the error:

Can't use an undefined value as a HASH reference at /usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/DBD/mysql.pm line 113.

which line of the c_sendfax its referring to? is it :

$dbh = $drh->connect('fax','fax','pfax') || die $DBI::errstr;

or the next one (or two), can you tell from the err msg?
0
dwodorisioAuthor Commented:
i cant tell from the error string. what line it is giving a problem on.
0
ozoCommented:
Is there a use of a HASH reference anywhere near line 113?
0
dwodorisioAuthor Commented:
well line 113 is code i never wrote. that is part of the DBD installation.
0
dwodorisioAuthor Commented:
hmm.. this morning i went back in and ran make test on the DBD install directory.. i have quite a few problems. ill list what they are when i can dig through them.

i must have skipped that test in my frustration and tiredness last night.

/d
0
dwodorisioAuthor Commented:
ok here is the errors when i test,

/usr/ccs/bin/make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base...........install_driver(mysql) failed: Can't load '/tmp/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal: libmysqlclient.so.12: open failed: No such file or directory at /usr/local/lib/perl5/5.8.5/sun4-solaris/DynaLoader.pm line 230.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at t/00base.t line 38

                                                                             
t/00base...........ok 1/5
                                                                             
t/00base...........ok 2/5
                                                                             
t/00base...........ok 3/5
                                                                             
t/00base...........dubious
        Test returned status 255 (wstat 65280, 0xff00)


hoever i think that i should get this error because im running the make from the tmp directory. when i install it i no longer get the error relating to the libmysqlclient.so.12 because it can find the file in /usr/local/mysql/lib/

0
dwodorisioAuthor Commented:
well.. i have solved the problem. looks like the code was written for an old version, i did a little modifications to teh code and its working now.
0
moduloCommented:
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.