MySQL Forums
Forum List  »  Connector/C++

Connection Timeout on remote DB connection
Posted by: Austin Taylor
Date: December 01, 2019 07:14AM

I am trying to use the c++ connector to connect to a remote db I am running on a virtual linux box. I keep getting this error:

CDK Error: Connection attempt to the server was aborted. Timeout of 10000 milliseconds was exceeded

This is my code:

#include <mysqlx/xdevapi.h>
#include <iostream>

int main()
{
try {
Session sess("db", 33060, "<user>", "<password>");
}
catch (const Error & err)
{
std::cout << "ERROR: " << err << std::endl;
}
catch (std::exception & ex)
{
std::cout << "STD EXCEPTION: " << ex.what() << std::endl;
}
catch (const char* ex)
{
std::cout << "EXCEPTION: " << ex << std::endl;
}


It works perfectly fine when I connect to localhost instance of mysql so I am not sure what the problem is. I can also connect to the remote db with mysql workbench so..?

Options: ReplyQuote


Subject
Views
Written By
Posted
Connection Timeout on remote DB connection
1244
December 01, 2019 07:14AM


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.