Skip Menu |

This queue is for tickets about the Net-MySQL CPAN distribution.

Report information
The Basics
Id: 21462
Status: open
Priority: 0/
Queue: Net-MySQL

People
Owner: Nobody in particular
Requestors: krisodb [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Problems with MySQL-5.0.21
Broken in 0.09, not tested with other versions. The connection to the database is ok. Inserting records, retrieving records afterwards is NOK. Use INET Socket: 10.254.2.253 3306/tcp Net::MySQL::_get_server_information(): 3E 00 00 00 0A 35 2E 30 2E 32 31 2D 63 6F 6D 6D .....5.0.21-comm 75 6E 69 74 79 00 21 00 00 00 6F 54 35 4D 61 21 unity.....oT5Ma. 7B 6E 00 2C A2 30 02 00 00 00 00 00 00 00 00 00 .n.,.0.......... 00 00 00 00 00 34 56 34 41 29 46 68 58 5E 50 58 .....4V4A)FhX.PX 46 00 F. Protocol Version: 10 Server Version: 5.0.21-community Salt: oT5Ma!{n4V4A)FhX^PXF Net::MySQL::_send_login_message(): 40 00 00 01 0F A2 00 00 00 00 00 40 08 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 61 75 74 6F 31 00 14 31 C2 97 43 C9 ....auto1..1..C. E6 FC BD 68 0C F8 C4 35 0D 43 0D 1D FE 28 2C 74 ...h...5.C...(,t 65 73 74 00 est. Net::MySQL::_request_authentication(): 01 00 00 02 FE ..... connect database Net::MySQL::_execute_command(): 3E 00 00 00 03 0A 20 20 20 20 49 4E 53 45 52 54 ..........INSERT 20 49 4E 54 4F 20 66 6F 6F 20 28 69 64 2C 20 6D .INTO.foo.(id,.m 65 73 73 61 67 65 29 20 56 41 4C 55 45 53 20 28 essage).VALUES.( 31 2C 20 27 48 65 6C 6C 6F 20 57 6F 72 6C 64 27 1,.'Hello.World' 29 0A ). Net::MySQL::_execute_command(): 16 00 00 03 FF 13 04 23 30 38 53 30 31 42 61 64 ........08S01Bad 20 68 61 6E 64 73 68 61 6B 65 .handshake send: Cannot determine peer address at /usr/lib/perl5/site_perl/5.8.7/Net/MySQL.pm line 293 MySQL is running on Windows XP. The perl script on linux. Perl version v5.8.7 built for x86_64-linux-thread-multi. I was able to install mysql on an other pc, it is working with the same actions. So the problem is in Net::MySQL. I've captured the packets send to the server I noticed a difference. For the login message, mysql is sending a different caps: 0fa2 while Net::MySQL is sending 0da6. This shouldn't matter I think since the server is giving the reponse OK. After this mysql is sending 2 more messages before sending the query's. The first one I'm not sure what it is. Message: 09 00 00 03 47 55 55 4b 56 57 48 4d 00 This is one, if I rerun the script the values will change. The second one is: "set autocommit=1" Any chance these messages are needed ? And that's the reason I get the bad handshake message ??
From: krisodb [...] gmail.com
I think I figured it out. In the reply on the login message, there is the byte 0xFE. This means the password needs to be resend using the old password protocol 10 algorithm. See also http://www.redferni.uklinux.net/mysql/MySQL-Protocol.html
From: krisodb [...] gmail.com
The changes in the attached file solve my problem. What's added: incase the server replies with the 0xFE, the password is resend using the old password protocol, using only the first part of the salt. On Wed Sep 13 07:35:39 2006, kob wrote: Show quoted text
> I think I figured it out. > In the reply on the login message, there is the byte 0xFE. This means > the password needs to be resend using the old password protocol 10 > algorithm. > See also http://www.redferni.uklinux.net/mysql/MySQL-Protocol.html > > >

Message body is not shown because it is too large.

From: pronovic [...] ieee.org
I have a similar problem. I am running on Windows XP SP2 using ActiveState Perl 5.10.0 (binary build 1001 from 18-Dec-2007). I am connecting to MySQL 5.0.22 running on RHEL. I installed Net::MySQL using ActiveState's ppm tool, which got me version 0.9. The local mysql client works just fine. However, my Perl script always fails with a "08S01 Bad Handshake" error, just like described in kob's original thread on the MySQL forum: http://forums.mysql.com/read.php?51,96826,115443#msg-115443 The error shows up when executing the first select. I took the updated MySQL.pm provided by kob (in the previous reply in this bug thread), and installed it to C:\Perl\site\lib\Net. That solved my problem. This bug report is over a year old. Could you please apply kob's changes and release a new version of this package -- or at least comment on this bug to let us know why the changes haven't been applied? Thanks.