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