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:
Thanks,
Marcus
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;
Marcus