Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

Connection Timeout on remote DB connection (no replies)

$
0
0
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..?

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>