Ok i have tried to search on google for the answers but i still cant fix this problem.
i have this error when trying to connect to the localhost
Can't connect to MySQL server on 'localhost' (10060)
i have fix it by changing the name 'localhost' to 127.0.0.1
so i tried to do same thing to my database online
i have the same problem...
Can't connect to MySQL server on 'XXX.domain.com' (10060)
i changed it to ip of host but still have the problem..
Can't connect to MySQL server on 'XXX.XXX.XXX.XXX' (10060)
any idea how to solve this ?
this is the code i use
MYSQL *conn;
conn = mysql_init(NULL);
if (conn == NULL) {
printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
exit(1);
}
if (mysql_real_connect(conn, "xxx.xxx.xxx.xxx", "xxxxxxx_xxxxxx",
"xxxxxxxxx", NULL, NULL, NULL, 0) == NULL) {
printf("Error %u: %s\n", mysql_errno(conn), mysql_error(conn));
}else
{
printf("success !!");
}
thanks