I compiled Connector/C from scratch, and when I try to connect using it, my_connect returns -1 and WSAGetLastError() == 2003
I have no clue what’s wrong, any ideas? I’ve tried googling but I can’t even find anything on what that error means.
MYSQL *my = mysql_init(NULL);
if(my)
{
MYSQL *result = mysql_real_connect(my, strHost.c_str(), strUser.c_str(), strPass.c_str(),
strDB.c_str(), uiPort, NULL, 0);
}
Edit: Odd, when I use 127.0.0.1 to connect rather than localhost, it works.
I’ve tracked the problem down to the MySQL C connector using the ipv6 getaddrinfo which returns ::1, I’m using an old mysql server version which doesn’t support ipv6.