Jerry,

u is an alias to the table name. It’s used to distinguish table so you don’t have to keep adding the full table. It’s usefulness comes in when selecting data from multiple tables

 

SELECT            u.param1, u.param2, p.param3

FROM               mytablename1 u, mytablename2 p

WHERE            u.param4 = p.param5

 

For this query you can leave it out.

 

Darren

 


From: Gerald Preston [mailto:[EMAIL PROTECTED]
Sent: 04 March 2005 09:33
To: 'Darren Barnes'; 'Mulley, Nikhil'; [email protected]
Subject: RE: accessing MySQL via Perl

 

What is u.user u in   “UPDATE        u.user u”?

 

Jerry

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darren Barnes
Sent: Friday, March 04, 2005 2:25 AM
To: 'Gerald Preston'; 'Mulley, Nikhil'; [email protected]
Subject: RE: accessing MySQL via Perl

 

It states in the documentation to use DBD-mysql 2.9004 but I still had the same problem even upgrading. I believe it’s not handling the new 41-bit length passwords.

 

To get round it you can either start the database with old_passwords (--old_passwords) enabled, then add the users but you will lose out on the new security enhancements.

 

You will also change the password for a user by using the inbuilt OLD_PASSWORD function as follows:

 

After connecting to mySQL as the administrator

UPDATE        u.user u

SET               Password = OLD_PASSWORD(‘<PASSWORD>’)

WHERE         User = ‘<UID>’

 

At the moment I still have got the new passwords to work but let me know I you do?

 

Regards

Darren

 

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
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to