[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2004-11-15
16
Medium Priority
?
561 Views
Last Modified: 2013-12-05
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
0
Comment
Question by:dwodorisio
15 Comments
 
LVL 7

Expert Comment

by:rugdog
ID: 12589780
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
 

Author Comment

by:dwodorisio
ID: 12589811
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
 

Author Comment

by:dwodorisio
ID: 12589855
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:dwodorisio
ID: 12589954
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
 
LVL 7

Expert Comment

by:rugdog
ID: 12590173
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
 

Author Comment

by:dwodorisio
ID: 12590178
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
 

Author Comment

by:dwodorisio
ID: 12590185
**********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
 
LVL 7

Expert Comment

by:rugdog
ID: 12590339
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
 

Author Comment

by:dwodorisio
ID: 12593281
i cant tell from the error string. what line it is giving a problem on.
0
 
LVL 85

Expert Comment

by:ozo
ID: 12593406
Is there a use of a HASH reference anywhere near line 113?
0
 

Author Comment

by:dwodorisio
ID: 12593427
well line 113 is code i never wrote. that is part of the DBD installation.
0
 

Author Comment

by:dwodorisio
ID: 12593571
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
 

Author Comment

by:dwodorisio
ID: 12593985
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
 

Author Comment

by:dwodorisio
ID: 12606233
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
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12911689
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question