Connection attempt failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
- Code: Select all
try {
// Exception thrown at this line:
_pSession = new Session(Connector::KEY, "user=pma;password=1209gT;db=devicesharing_db1;compress=false;auto-reconnect=true");
string name;
// a simple query
Statement select(*_pSession);
select << "SELECT name FROM `j4s92_users`", into(name), range(0,1), now;
select.execute();
cout << "Name: " << name;
} catch(Poco::Exception& e)
{
std::cerr << e.displayText();
}
I run the Connector::registerConnector(); and Connector::unregisterConnector(); at the CTor and DTor of the class. The exception message I got at the marked line.





