List:MySQL++« Previous MessageNext Message »
From:Ney André de Mello Zunino Date:November 25 2004 8:08pm
Subject:MySQL 4.1 and MySQL++ 1.7.23: "Bad handshake"
View as plain text  

I have downloaded and installed MySQL 4.1 on my Windows XP system. I 
also installed the /Administrator/ and /Query Browser/ tools, which are 
all working as expected. Then I downloaded the MySQL++ library version 
1.7.23 and managed to build it with VS.NET 2003. So I went on to build 
my first simple application. I created a test database from script and 
then used the administrator tool to create a new user and give him full 
access to the newly created database. Accessing the database with the 
new user's credentials from the query tool worked fine. However, my 
application will not successfully negotiate access with the MySQL 
server, raising a /BadQuery/ exception. After searching around, I found 
some pages which advised about using the /OLD_PASSWORD()/ function to 
replace the password encrypted with the new scheme. That did not work 
either and the exception was still being thrown. So I tried leaving the 
password blank and was finally able to connect. The code is as follows:

#include <mysql++.h>
using namespace mysqlpp;

#include <iostream>
using namespace std;

int main()
     Connection con("ufsc", "localhost", "zunino", "mypasswd");
     Query query = con.query();
     query << "select nomeAluno from aluno";
     cout << "Query: " << query.preview() << '\n';
     Result res =;
     cout << res.size() << " record(s) found\n";
   catch (const BadQuery& e)
     cerr << e.what() << '\n';
   catch (...)
     cerr << "Oops, something else happened...\n";

Does anybody know the cause of the problem and how to solve it?

Thank you,

Ney André de Mello Zunino
Graduando em Ciência da Computação
Universidade Federal de Santa Catarina
MySQL 4.1 and MySQL++ 1.7.23: "Bad handshake"Ney André de Mello Zunino25 Nov
  • Re: MySQL 4.1 and MySQL++ 1.7.23: "Bad handshake"Warren Young29 Nov
    • Re: MySQL 4.1 and MySQL++ 1.7.23: "Bad handshake"Ney André de Mello Zunino29 Nov
      • Re: MySQL 4.1 and MySQL++ 1.7.23: "Bad handshake"Warren Young29 Nov