Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 8182
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: martin.p.charbonneau [...] cgi.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.9003
Fixed in: (no value)



Subject: Authentication error with MySQL 4.1.7 and dbd-mysql 2.9003
I'm using MySQL 4.1.7 for WindowsXP Pro, all latest patch but sp2 Active Perl 5.8.3 with DBI v1.45 and DBD-MySQL v 2.9003 (both latest version according to ppm) When trying to connect to DB with "authentified user" ie : username and password as example below, get and error. Example: #!/usr/local/bin/perl use strict; use DBI; my $database = "my_db"; my $hostname = "localhost"; my $port = 3306; my $user = "auth_user"; my $password = "password"; my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; my $dbh = DBI->connect($dsn, $user, $password); my $sth = $dbh->prepare("show tables"); $sth->execute; #... $sth->finish; $dbh->disconnect(); ----------------------------------------- Output at command prompt: DBI connect('database=mailstats_db;host=localhost;port=3306','auth_user',...) failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client at <path of my script> line <line number of the DBI->connect> User "auth_user" as proper password and access rights. I've used the same script with user that has no password and it worked correctly. I've used the same script with "root" user / password and got the same error. Can you help?
From: martin.p.charbonneau [...] cgi.com
[guest - Fri Oct 29 17:06:59 2004]: Show quoted text
> I'm using MySQL 4.1.7 for WindowsXP Pro, all latest patch but sp2 > Active Perl 5.8.3 with DBI v1.45 and DBD-MySQL v 2.9003 (both latest > version according to ppm) > > When trying to connect to DB with "authentified user" ie : username > and password as example below, get and error. > > Example: > > #!/usr/local/bin/perl > use strict; > use DBI; > my $database = "my_db"; > my $hostname = "localhost"; > my $port = 3306; > my $user = "auth_user"; > my $password = "password"; > my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; > my $dbh = DBI->connect($dsn, $user, $password); > my $sth = $dbh->prepare("show tables"); > $sth->execute; > #... > $sth->finish; > $dbh->disconnect(); > ----------------------------------------- > Output at command prompt: > DBI > connect
('database=mailstats_db;host=localhost;port=3306','auth_user',...) Show quoted text
> failed: Client does not support authentication protocol requested > by server; consider upgrading MySQL client at <path of my script> > line <line number of the DBI->connect> > > User "auth_user" as proper password and access rights. > I've used the same script with user that has no password and it
worked Show quoted text
> correctly. > I've used the same script with "root" user / password and got the
same Show quoted text
> error. > > Can you help? > >
I was able to make it work by following this "procedure" - Add following lines in my.ini (<MYSQL install dir>/my.ini) #Use old password encryption method (needed for 4.0 and older clients). old-passwords - OR, use the MySQL Admininistrator, Startup Variables, Security, Select "Use old Password" - Reset the password for the auth_user that will be used It should work fine. Version MySQL 4.1.x as changed the encryption from 45 bits to 41 bits. Or at least I believe that's where the problem is coming from. It would be nice to have to option in DBD-MySQL or DBI to select type of encryption so we can use either MySQL < 4.1 and MySQL >= 4.1