LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices



Reply
 
Search this Thread
Old 09-10-2004, 08:10 AM   #1
kaN5300
LQ Newbie
 
Registered: Sep 2004
Location: Russia
Distribution: Slackware linux 10
Posts: 27

Rep: Reputation: 15
perl | DBI->connect | RHEL AS 3


I have a 100% workin script in perl, and i also set up a mysql server, so when i try to run dis perl scrits, it says:
Code:
[root@games hlstats]# ./hlstats.pl
++ HLstats 1.20 starting...

-- Opening UDP listen socket on port 27500 ... opened OK
-- Connecting to MySQL database 'hlstats' on 'localhost' as user 'root' ... install_driver(mysql) failed: Can't load '/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.10: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229.
 at (eval 4) line 3
Compilation failed in require at (eval 4) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at ./hlstats.pl line 971
[root@games hlstats]#
This is what in da 971 line
Code:
print "-- Connecting to MySQL database '$db_name' on '$db_host' as user '$db_user' ... ";

$db_conn = DBI->connect(
        "DBI:mysql:$db_name:$db_host",
        $db_user, $db_pass
) or die ("\nCan't connect to MySQL database '$db_name' on '$db_host'\n" .
        "Server error: $DBI::errstr\n");

print "connected OK\n";
I tryed 2 find any modules, that support myaql+perl working
Code:
[root@games hlstats]# rpm -qa | grep perl
perl-Parse-Yapp-1.05-30
perl-XML-Grove-0.46alpha-25
perl-CPAN-1.61-88.4
mod_perl-1.99_09-10.ent
perl-Time-HiRes-1.38-3
perl-DateManip-5.40-30
perl-XML-Dumper-0.4-25
newt-perl-1.08-4
perl-Digest-SHA1-2.01-15.1
perl-HTML-Tagset-3.03-28
perl-libwww-perl-5.65-6
perl-XML-Encoding-1.01-23
perl-Digest-HMAC-1.01-11.1
perl-DB_File-1.804-88.4
perl-DBD-Pg-1.21-2
perl-5.8.0-88.4
perl-HTML-Parser-3.26-17
perl-XML-Parser-2.31-15
perl-libxml-enno-1.02-29
perl-SGMLSpm-1.03ii-11
perl-Net-DNS-0.31-3.1
perl-libxml-perl-0.07-28
perl-CGI-2.81-88.4
perl-DBI-1.32-5
perl-DBD-MySQL-2.1021-3
perl-Filter-1.29-3
perl-URI-1.21-7
perl-XML-Twig-3.09-3
[root@games hlstats]#
So, how can i run my script?
 
Old 09-11-2004, 12:28 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
You need to look at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229 to understand what is failing. But the error is very descriptive: It looks like one of the share libraries is not where it should be. It may have been deleted, never installed, or you might need to create a symlink to it where it's really installed.
 
Old 09-11-2004, 02:32 AM   #3
kaN5300
LQ Newbie
 
Registered: Sep 2004
Location: Russia
Distribution: Slackware linux 10
Posts: 27

Original Poster
Rep: Reputation: 15
Thet is wat is thet file (listing begins with line 229)
Code:
    my $libref = dl_load_file($file, $module->dl_load_flags) or
        croak("Can't load '$file' for module $module: ".dl_error());

    push(@dl_librefs,$libref);  # record loaded object

    my @unresolved = dl_undef_symbols();
    if (@unresolved) {
        require Carp;
        Carp::carp("Undefined symbols present after loading $file: @unresolved\
    }
I dont understand what the library i miss, and where i have 2 put it?
 
Old 09-11-2004, 05:42 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
You're missing either this: /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so
or this: libmysqlclient.so.10

(the error message isn't totally clear on whether it couldn't find the first file, or whether it couldn't load the first library because the second was missing).

I would start by verifying that /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so exists in that path. If it doesn't, look for mysql.so and see where else it might be. You can use the find command to do this:
$ find / -name mysql.so
if it's not in the right place, try making a copy and putting it in the directory that PERL expects.

If that's all find, then look for libmysqlclient.so.10 in the same way.
 
Old 09-13-2004, 03:18 AM   #5
kaN5300
LQ Newbie
 
Registered: Sep 2004
Location: Russia
Distribution: Slackware linux 10
Posts: 27

Original Poster
Rep: Reputation: 15
With da first lib, its ok:
Code:
[root@games root]# find / -iname "*mysql.so*" -print
/tmp/mysql.sock
/usr/lib/python2.2/site-packages/_mysql.so
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so
/usr/lib/qt-3.1/plugins/sqldrivers/libqsqlmysql.so
/usr/lib/httpd/modules/mod_auth_mysql.so
/usr/lib/dbd/libmysql.so
But with libmysqlclient.so.10 a trouble have plase, i cant locate, where it is:
Code:
[root@games root]# find / -iname "*libmysqlclient.so.10*" -print
[root@games root]#
What shell i do 2 fix thet?
 
Old 09-13-2004, 01:57 PM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
try just "*libmysqlclient.so.*", there may be a different version of the library installed. Although it's not recommended, it may be possible to symlink a different version of the library to .10.
 
Old 09-14-2004, 09:15 AM   #7
kaN5300
LQ Newbie
 
Registered: Sep 2004
Location: Russia
Distribution: Slackware linux 10
Posts: 27

Original Poster
Rep: Reputation: 15
I have solved all problems with perl modules, no i have another trouble with mysql:
Code:
[root@games hlstats]# ./hlstats.pl
++ HLstats 1.20 starting...

-- Opening UDP listen socket on port 27500 ... opened OK
-- Connecting to MySQL database 'hlstats' on 'localhost' as user 'root' ... DBI connect('hlstats:localhost','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at ./hlstats.pl line 971

Can't connect to MySQL database 'hlstats' on 'localhost'
Server error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@games hlstats]#
Why cant mysqlserver support unix sockets? What i did wrong?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Perl DBI question GoTrolling Linux - Newbie 1 03-21-2007 05:31 AM
Mysql reading via Perl DBI ivanatora Programming 2 03-21-2007 05:03 AM
Perl - DBI PG Installation Problems TheMeteorPolice Linux - Software 2 11-23-2005 11:53 AM
perl DBI prepare question mrtwice Programming 1 10-30-2003 03:12 PM
connecting from Linux to MS SQL using perl DBI->connect Aniket Linux - Software 0 08-08-2002 06:42 PM


All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration