Not able to access MySql database using perl script

Not able to access MySql database using perl script

am 05.03.2003 10:41:40 von Umesh

------=_NextPart_000_02CA_01C2E329.8676EBA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I have installed MySql database on HPUX 11.11 machine and I have also
installed perl database interface drivers DBI and DBD-mysql. If I try to
access the database through perl script, it gives out an error as below =
and
dumps core.


/usr/lib/dld.sl: Unresolved symbol: mysql_init (code) from
/opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1/auto/DBD/mysql/mys ql.sl

The versions of drivers and perl are:
Perl 5.6.1
DBI-1.13
DBD-mysql-2.1012

The perl script is as below:
#!/opt/perl5/bin/perl

use DBI;

my $dsn =3D 'DBI:mysql:mydb:localhost';
my $db_user_name =3D 'myuser';
my $db_password =3D 'xport';
my $dbh =3D DBI->connect($dsn, $db_user_name, $db_password);

my $sth =3D $dbh->prepare(qq{ select empid, empname from employee });
$sth->execute();
while (my ($id, $name) =3D
$sth->fetchrow_array()) # keep fetching until
# there's nothing left
{
print "$id, $name\n";
}
$sth->finish();

Can someone help me in resolving this issue.

Thanks and regards,
Umesh



------=_NextPart_000_02CA_01C2E329.8676EBA0--

Re: Not able to access MySql database using perl script

am 05.03.2003 12:07:35 von Jochen Wiedmann

Zitiere Umesh :

> /usr/lib/dld.sl: Unresolved symbol: mysql_init (code) from
> /opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1/auto/DBD/mysql/mys ql.sl

This is most probably due to a missing dynamic library.
(libmysqlclient.so or similar)

Try setting the LD_LIBRRARY_PATH environment variable to
the directory where it is located.


Jochen

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread2072@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Not able to access MySql database using perl script

am 05.03.2003 12:07:35 von Jochen Wiedmann

Zitiere Umesh :

> /usr/lib/dld.sl: Unresolved symbol: mysql_init (code) from
> /opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1/auto/DBD/mysql/mys ql.sl

This is most probably due to a missing dynamic library.
(libmysqlclient.so or similar)

Try setting the LD_LIBRRARY_PATH environment variable to
the directory where it is located.


Jochen

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread2072@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.