FW: Mysql Perl Issue



-----Original Message-----
From: Doug Pisarek [mailto:dgp [at] strata-group.com]
Sent: Friday, October 09, 2009 3:50 PM
To: perl [at] lists.mysql.com
Subject: Mysql Perl Issue

Problem getting Perl to connect to mysql database. Here is all of the
information:

$ perl -v

This is perl, v5.8.4 built for sun4-solaris-64int (with 29 registered
patches, see perl -V for more detail)

Copyright 1987-2004, Larry Wall

Perl may be copied only under the terms of either the Artistic License
or the GNU General Public License, which may be found in the Perl 5
source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to
the Internet, point your browser at http://www.perl.com/, the Perl Home
Page.
mysql Ver 14.12 Distrib 5.0.51a, for sun-solaris2.10 (sparc) using
readline 5.0
------------------------------------------------------------ ------------
---------------------------------------------------
$ mysql -V
mysql Ver 14.12 Distrib 5.0.51a, for sun-solaris2.10 (sparc) using
readline 5.0
------------------------------------------------------------ ------------
----------------------------
Code running:
#!/usr/bin/perl

use DBI;

print <<END;
Content-type: text/html

<html>
<head>
<title>Example of Perl calling MySQL</title> </head>

<body bgcolor=3D"white">

END

# database information
print"DB connect\n";
$db=3D"c3c_v8_24_dev";
$host=3D"db110g";
$userid=3D"root";
$passwd=3D"strata";
$connectionInfo=3D"dbi:mysql:$db;$host";

# make connection to database
print"Make connection \n";
$dbh =3D DBI->connect($connectionInfo,$userid,$passwd) ||
die "Got error $DBI::errstr when connecting to $dsn\n";

# prepare and execute query
$query =3D "SELECT userid, user_name FROM ad_user"; $sth =3D
$dbh->prepare($query); $sth->execute();

# assign fields to variables
$sth->bind_columns(\$userid, \$user_name);

# output name list to the browser
print "Names in the people database:<p>\n"; print "<table>\n";$
../mysql_print.pl
Content-type: text/html

while($sth->fetch()) {
print "<tr><td>$userid<td>$user_name\n";
}
print "</table>\n";
print "</body>\n";
print "</html>\n";

$sth->finish();

# disconnect from database
$dbh->disconnect;

Error receiving:

$ ./mysql_print.pl
Content-type: text/html

<html>
<head>
<title>Example of Perl calling MySQL</title> </head>

<body bgcolor=3D"white">

DB connect
Make connection
ld.so.1: perl: fatal: relocation error: file
/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/mysql /mysql.so:
symbol mysql_init: referenced symbol not found Killed


<html>
<head>
<title>Example of Perl calling MySQL</title> </head>

<body bgcolor=3D"white">

DB connect
Make connection
ld.so.1: perl: fatal: relocation error: file
/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBD/mysql /mysql.so:
symbol mysql_init: referenced symbol not found Killed


Thanks,
Doug P.



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules [at] m.gmane.org
Doug Pisarek [ Fr, 09 Oktober 2009 22:54 ] [ ID #2018573 ]
Datenbanken » gmane.comp.db.mysql.perl » FW: Mysql Perl Issue

Vorheriges Thema: Rownum View Function
Nächstes Thema: Mysql Perl Issue