activeperl@listserv.ActiveState.com
[Top] [All Lists]

RE: accessing MySQL via Perl

Subject: RE: accessing MySQL via Perl
From: "Chad I. Uretsky"
Date: Fri, 4 Mar 2005 13:54:37 -0000
Perhaps instead of:
 
my $dbh=DBI->connect( 'dbi:mysql:club', 'gjwpp88', 'xxxxxxxxx' ) or die "\n$DBI::errstr\n";
 
 
you could try:
 
$dbh = DBI->connect ("DBI:mysql:host=localhost;database=club","gjwpp88","xxxxxxxxx") or die "\n$DBI::errstr\n";
 
 
You might even try:
 
$dbh = DBI->connect ("DBI:mysql:host=localhost;database=club;port=<port number>","gjwpp88","xxxxxxxxx") or die "\n$DBI::errstr\n";
 
where <port number> is the port on which your MySQL database is listening.
 
 
Chad Uretsky
Lead Network and Security Engineer

NetIQ Corporation

chad.uretsky@xxxxxxxxx
Direct: 713-418-5200

www.netiq.com 

  
 

-----Original Message-----
From: activeperl-bounces@xxxxxxxxxxxxxxxxxxxxxxxx [mailto:activeperl-bounces@xxxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Gerald Preston
Sent: Friday, March 04, 2005 1:33 AM
To: activeperl@xxxxxxxxxxxxxxxxxxxxxxxx
Subject: accessing MySQL via Perl

Hi!

>

I am using Perl -v 5.8 and MySQL 4.1.10, just installed today.

> 

I am inserting some data with r following code:

> 

> 

#!/perl

use warnings;

use strict;

use DBI;

#use DBD-mysql;

> 

  my $group_name = "beer";

  my $me         = "E";

  my $daily      = "03032005";

  my $item       = "Bacardi";

  my $unit       = "2";

  my $qty        = "3";

  my $amount     = "6";

  my $tax        = "0.41";

  my $total      = "6.41";

> 

  my $dbh=DBI->connect( 'dbi:mysql:club', 'gjwpp88', 'xxxxxxxxx' ) or die "\n$DBI::errstr\n";

> 

  my $sql = "insert into wolfies( group_name, me, daily, item, unit, qty, amount, tax, total )

                          values( ?,          ?,  ?,     ?,    ?,    ?,   ?,      ?,   ?     ) ";

  my $sth = $dbh->prepare( $sql ) or die $dbh->errstr if $dbh->err;

> 

 $sth->execute( $group_name, $me, $daily, $item, $unit, $qty, $amount, $tax, $total ) or warn "Cannot execute FIRST Statement!!\n$DBI::errstr";

> 

I get "DBI connect<'club','gjwpp88',....> failed; Client does not support authentication protocol requested by server"

> 

Any ideas?

> 

Thanks,

> 

Jerry

> 

  

_______________________________________________
ActivePerl mailing list
ActivePerl@xxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
<Prev in Thread] Current Thread [Next in Thread>