Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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

C++
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...
C++
Can't connect to MySQL server on 'XXX.domain.com' (10060)

i changed it to ip of host but still have the problem..
C++
Can't connect to MySQL server on 'XXX.XXX.XXX.XXX' (10060)


any idea how to solve this ?

this is the code i use

C#
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
Posted
Comments
Maciej Los 26-Apr-13 12:34pm    
RedDk 26-Apr-13 16:39pm    
Have you recently upgraded your antivirus? Through what app are you connecting?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900