3 messages in com.mysql.lists.perlRe: 'Bad handshake' (1043) after upgr...
FromSent OnAttachments
Robert Sinton01 Jun 2004 22:02 
Rudy Lippan02 Jun 2004 08:47 
Robert Sinton02 Jun 2004 19:18 
Subject:Re: 'Bad handshake' (1043) after upgrading MySQL from 4.1.0 to 4.1.2
From:Robert Sinton (rob@magnummac.co.nz)
Date:06/02/2004 07:18:39 PM
List:com.mysql.lists.perl

Very good point. Trying this initially gave a compilation error: ... cc -c -I/Library/Perl/darwin/auto/DBI -I/usr/local/mysql/include
-fno-omit-frame-pointer -g -pipe -pipe -fno-common -no-cpp-precomp
-flat_namespace -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -Os
-DVERSION=\"2.9003\" -DXS_VERSION=\"2.9003\"
"-I/System/Library/Perl/darwin/CORE" mysql.c mysql.xs: In function `XS_DBD__mysql__GetInfo_dbd_mysql_get_info': mysql.xs:355: `net_buffer_length' undeclared (first use in this function) mysql.xs:355: (Each undeclared identifier is reported only once mysql.xs:355: for each function it appears in.) make: *** [mysql.o] Error 1 /usr/bin/make -- NOT OK

Looks like there have been some significant changes in the handling of
net_buffer_length. In MySQL 4.1.0 it occurs in the following places: include/mysql_com.h:extern unsigned long net_buffer_length; support-files/my-medium.cnf:set-variable = net_buffer_length=8K support-files/my-small.cnf:set-variable = net_buffer_length=2K But in MySQL 4.1.2 we have: docs/ChangeLog: use opt_net_buffer_length instead of net_buffer_length docs/ChangeLog: local opt_max_allowed_packet and opt_net_buffer_length
introduced include/mysql.h: unsigned long *p_net_buffer_length; include/mysql.h:#define net_buffer_length
(*mysql_get_parameters()->p_net_buffer_length) support-files/my-medium.cnf:net_buffer_length = 8K support-files/my-small.cnf:net_buffer_length = 2K

More specifically, from include/mysql.h: #if !defined(MYSQL_CLIENT) && !defined(MYSQL_SERVER) &&
!defined(EMBEDDED_LIBRARY) #define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet) #define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length) #endif

So as a quick and dirty fix, I duplicated the definition for net_buffer_length
after (i.e. outside) this conditional in mysql.h. This got around the compilation
error, and the 'make' carried through to completion.

However, it doesn't seem to have made any difference to the original problem. I
still get the same 'Bad handshake' error message :-(

Some further testing established that this problem only occurs when a password
is required, i.e. if privileges are granted to a user without the need for a password, the problem does not occur. When a password is required, the same error message
occurs whether a correct or incorrect password is supplied.

Cheers, Robert

-- Robert Sinton Phone +64 (3) 366-5454 Senior Systems Consultant Fax +64 (3) 366-4456 MagnumMac Resources Ltd 21-23 Carlyle Street, PO Box 1144, Christchurch

The penalty that good men pay for not being interested in politics is to be governed by men worse than themselves. -- Plato, philosopher (427-347 BCE)

On Thursday, 3 June 2004 3:48 AM, Rudy Lippan <rlip@remotelinux.com> wrote:

On 2 Jun 2004, Robert Sinton wrote:

I'm bound to be missing something obvious here, but after upgrading my MySQL server from 4.1.0 to 4.1.2, I get the above errstr/err when issuing a DBI->connect.

I have confirmed that I can log in and use the database satisfactorily using the mysql client; I can also swap the server back to 4.1.0 and connect as expected. There is nothing coming up in the MySQL error log.

Server is OS X 10.2.6, perl 5.6.0. DBI & DBD::MySQL are up to date.

Any ideas/diagnostic suggestions/magic answers much appreciated.

Try re-compiling DBD::mysql against the 4.1.2 libraries.