MySQL Forums
Forum List  »  Connector/C++

connector not working on different machines
Posted by: Stev Fro
Date: August 31, 2011 01:55PM

Hi

I have built MySQL Connector 1.1.0 C++ from source using Visual Studio 2008 on two different machines following the same procedure (both machines are using a windows XP operating system). I can compile and link to all the necessary libraries on both machines.

On machine A the example code connect.cpp runs and connects fine to my mysql database running on a separate linux machine.

On machine B the example code connect.cpp gets to line 73 which is:
std::auto_ptr< sql::Connection > con(driver->connect(url, user, pass));

and throws the error message:

# ERR: SQLException in .\connect.cpp<main> on line 214
# ERR: Lost connection to MySQL server at 'waiting for initial communication packet', system error: 0 <MySQL error code: 2013, SQLState: HY000 >
not ok 1 - examples/connect.php

I know the connection to the database is working because I can ping the database from both machines A and B as well as connect to the database using SQLyog on both.

Furthermore if I grab connect.exe, libmysql.dll, and mysqlcppconn.dll and throw them on a flash drive from machine B they will run and connect on machine A.

I do not understand why machine A would work fine, however machine B does not, even though the same procedure was used for both to build and run Connect C++. If someone could help me figure this out I would greatly appreciate it.

Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
connector not working on different machines
3561
August 31, 2011 01:55PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.