dbTalk Databases Forums  

Bad handshake

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Bad handshake in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim Shor
 
Posts: n/a

Default Bad handshake - 05-10-2005 , 01:06 PM






------_=_NextPart_001_01C5558A.B2C5F1A3
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello everyone.

Using latest mysql++ and MySQL 5.0.4

=20

Windows XP, VisualStudio .NET 2003, utilizing Windows Forms.

=20

Able to connect to mysql only with empty params:

mysqlpp::Connection con(true);

bool rc =3D con.connect("test", "", "", "");

String *temp =3D con.client_info();

=20

And for some reason getting version 4.1.0-alpha, while MySQL
Administrator gives me client version 5.0.0

=20

When connecting this way:

mysqlpp::Connection con("test", "localhost", "root", "password", true);

=20

getting "Bad Handshake" error.

=20

Also when I do this:

mysqlpp::Connection con(true);

if(con.real_connect("test", "localhost", "root", "password",3306)){

String *temp =3D con.client_info().c_str();

this->textBox1->set_Text(temp);

}

=20

This gives me "Bad Handhsake" error as well.

=20

I would like to connect with valid user, password, host parameters.

=20

Any help will be greatly appreciated.

=20

Thanks.

=20

=20

Timofey Shor

Software Engineer

PARLEC, Inc.

Fairport, NY, 14450

* (585) 425-4400, ext. 3087

* timsho (AT) parlec (DOT) com <mailto:timsho (AT) parlec (DOT) com>=20

=20


------_=_NextPart_001_01C5558A.B2C5F1A3--

Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Bad handshake - 05-10-2005 , 01:33 PM






Tim Shor wrote:
Quote:
And for some reason getting version 4.1.0-alpha, while MySQL
Administrator gives me client version 5.0.0
"Bad Handshake" indicates that the client is trying to speak the wrong
protocol to the server.

Is it possible that you have two versions of MySQL installed on your
system, and are building against one but trying to connect to the other?
Or, that you are using a pre-built version of MySQL++ instead of
building it against the libraries and headers on your system?

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Nicholas Watmough
 
Posts: n/a

Default Re: Bad handshake - 05-12-2005 , 11:55 PM



I've had the same problem - I can connect when connecting as a user with
no password, but not as a user with a password.

However, this is not a problem with MySQL++, but rather with the
underlying C API.

Try connecting using mysql_real_connect(), and you should have the same
problem. I've posted to the general MySQL list, but haven't received
much of a response yet.

Warren Young wrote:

Quote:
Tim Shor wrote:


And for some reason getting version 4.1.0-alpha, while MySQL
Administrator gives me client version 5.0.0


"Bad Handshake" indicates that the client is trying to speak the wrong
protocol to the server.

Is it possible that you have two versions of MySQL installed on your
system, and are building against one but trying to connect to the
other? Or, that you are using a pre-built version of MySQL++ instead
of building it against the libraries and headers on your system?

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Tim Shor
 
Posts: n/a

Default RE: Bad handshake - 05-13-2005 , 06:33 AM



Make sure that the correct libMySQL.dll is being loaded,
Every time you install something new that utilizes libMySQL.dll it is
installing it in some Global path (like WINDOWS/System32 or other) and
during the runtime it is loading it instead of the one that you are
referencing in your project.

I would recommend to search your PC for libMySQL.dll to find all the
occurrences and verify that those are the right ones.
Another thing could be done, is that you can place the latest
libMySQL.dll in the directory where your application resides, so that
WINDUHS load the one that is located in the same directory as your app.

Regards,

Timofey Shor
Software Engineer
PARLEC, Inc.
Fairport, NY, 14450
( (585) 425-4400, ext. 3087
+ timsho (AT) parlec (DOT) com

-----Original Message-----
From: Nicholas Watmough [mailto:nickw (AT) deakin (DOT) edu.au]=20
Sent: Friday, May 13, 2005 12:55 AM
To: MySQL++ Mailing List
Subject: Re: Bad handshake

I've had the same problem - I can connect when connecting as a user with

no password, but not as a user with a password.

However, this is not a problem with MySQL++, but rather with the=20
underlying C API.

Try connecting using mysql_real_connect(), and you should have the same=20
problem. I've posted to the general MySQL list, but haven't received=20
much of a response yet.

Warren Young wrote:

Quote:
Tim Shor wrote:


And for some reason getting version 4.1.0-alpha, while MySQL
Administrator gives me client version 5.0.0


"Bad Handshake" indicates that the client is trying to speak the wrong

protocol to the server.

Is it possible that you have two versions of MySQL installed on your=20
system, and are building against one but trying to connect to the=20
other? Or, that you are using a pre-built version of MySQL++ instead

of building it against the libraries and headers on your system?

--=20
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsu...rlec (DOT) com


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #5  
Old   
Nicholas Watmough
 
Posts: n/a

Default Re: Bad handshake - 05-16-2005 , 09:20 AM



I'm actually statically linking the library libmysql.lib with my
executable at compile time, rather than dynamically linking the dll. And
I'm linking with the version that comes packaged with server version
4.1.10. So I'm pretty sure that's not the problem.

Besides, as far as I'm aware, version 4.1.10 (which I installed), is the
only version of the server that has ever been installed on the computer,
so I don't think there would be any previous versions of the client
library floating around.

Nick

Tim Shor wrote:

Quote:
Make sure that the correct libMySQL.dll is being loaded,
Every time you install something new that utilizes libMySQL.dll it is
installing it in some Global path (like WINDOWS/System32 or other) and
during the runtime it is loading it instead of the one that you are
referencing in your project.

I would recommend to search your PC for libMySQL.dll to find all the
occurrences and verify that those are the right ones.
Another thing could be done, is that you can place the latest
libMySQL.dll in the directory where your application resides, so that
WINDUHS load the one that is located in the same directory as your app.

Regards,

Timofey Shor
Software Engineer
PARLEC, Inc.
Fairport, NY, 14450
( (585) 425-4400, ext. 3087
+ timsho (AT) parlec (DOT) com

-----Original Message-----
From: Nicholas Watmough [mailto:nickw (AT) deakin (DOT) edu.au]
Sent: Friday, May 13, 2005 12:55 AM
To: MySQL++ Mailing List
Subject: Re: Bad handshake

I've had the same problem - I can connect when connecting as a user with

no password, but not as a user with a password.

However, this is not a problem with MySQL++, but rather with the
underlying C API.

Try connecting using mysql_real_connect(), and you should have the same
problem. I've posted to the general MySQL list, but haven't received
much of a response yet.

Warren Young wrote:



Tim Shor wrote:



And for some reason getting version 4.1.0-alpha, while MySQL
Administrator gives me client version 5.0.0


"Bad Handshake" indicates that the client is trying to speak the wrong





protocol to the server.

Is it possible that you have two versions of MySQL installed on your
system, and are building against one but trying to connect to the
other? Or, that you are using a pre-built version of MySQL++ instead





of building it against the libraries and headers on your system?






--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.