I am accessing a MySQL database within a C++ app using MySQL C++ Connector. It works fine if I have the C++ and the MySQL on the same machine. So, something like the following code works fine:
sql::Connection *_con;
sql::mysql::MySQL_Driver *_driver;
_driver = sql::mysql::get_mysql_driver_instance();
_con = _driver->connect("tcp://127.0.0.1:3306", "user", "password");
However, I can't seem to access the database if it is located on another machine. So, something like this:
sql::Connection *_con;
sql::mysql::MySQL_Driver *_driver;
_driver = sql::mysql::get_mysql_driver_instance();
_con = _driver->connect("tcp://somesite.com:3306", "user", "password");
Is it just not possible or am I doing something wrong?