Client authorization problem with MySQL 5.5 upgrade

Web hosting discussion, programming, and shared and dedicated servers.
6 posts Page 1 of 1
by meyerbo2 » Sat Nov 26, 2011 3:00 pm
Hi,
I am using Perl's DBI library to perform database calls within our Perl CGI scripts. When I call the Perl scripts directly from a Shell, they run fine against the new MySQL5.5 database, but when they get invoked through CGI from the web server, I get the following error:
Can't connect to database: Client does not support authentication protocol requested by server; consider upgrading MySQL client.

Searching the web, this indicates that the client making the call doesn't support MySQL 5.5's new password hashing algorithm.

Does anyone know how to solve this problem?

My script looks like this:

Code: Select all

#!/usr/local/bin/perl
use DBI;
#definition of variables
$db="meyerbo2_cs5";
$host="meyerbo2-cs5.db.sonic.net";
$user="meyerbo2_cs5-rw";
$password="XXXXXXXX";  # the root password
$numArgs = $#ARGV + 1;
$rv = 1;

if ($numArgs >= 2)
{
  #connect to MySQL database
  my $dbh   = DBI->connect ("DBI:mysql:database=$db:host=$host",
                           $user,
                           $password)
                           or print "Can't connect to database: $DBI::errstr\n";

  my $arg1_data = $dbh->quote($ARGV[1]);

  #prepare the query
  my $sth = $dbh->prepare( "
              SELECT cust_data
              FROM meyerbosdb
              WHERE cust_id=$arg1_data");

  #execute the query
  $sth->execute( );
  ## Retrieve the results of a row of data and print
  if ( my @row = $sth->fetchrow_array( ) )  {
         print "@row\n";
         $rv = 0;
  }
  if ( $sth->err( ) )
  {
    warn "Problem in retrieving results", $sth->errstr( ), "\n";
  }
  $sth->finish( );
  $dbh->disconnect or warn "Disconnection error: $DBI::errstr\n";
}
exit $rv;
Thanks,
Marcus
by kgc » Mon Nov 28, 2011 1:05 pm
Marcus, we're working on upgrading the perl mysql modules now.
Kelsey Cummings
System Architect, Sonic.net, Inc.
by williamt » Tue Nov 29, 2011 11:04 am
Marcus, could you try now?


Thanks,
William
Sr. Systems Administrator @ sonic.net
by meyerbo2 » Tue Nov 29, 2011 9:53 pm
Thanks for helping out with this. The calls work great from our main account now, but are still broken on ssl.sonic.net. Can you update the perl mysql modules on that machine also?
by williamt » Tue Nov 29, 2011 10:09 pm
Sorry about that meant to fix that box too today.
It should all be working for you now.
Sr. Systems Administrator @ sonic.net
by meyerbo2 » Thu Dec 01, 2011 8:55 pm
Thanks. Things seem to be working great. I plan to do a full migration this weekend. We appreciate your effort.
6 posts Page 1 of 1

Who is online

In total there are 27 users online :: 0 registered, 0 hidden and 27 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 27 guests