SA-MP Forums Archive
MySQL connecting problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: MySQL connecting problem (/showthread.php?tid=259340)



MySQL connecting problem - Pooh7 - 04.06.2011

I have a problem with connecting server to MySQL database.
Server was online previous 30 days and worked without any problems. But today I saw this error in MySQL log:

Code:
[21:40:00] CMySQLHandler::Connect() - Can't connect to MySQL server on '213.239.205.210' (110) (Error ID: 2003)
It's remote machine, not localhost.


Code for connecting:
pawn Code:
#define MYSQL_HOST              "213.239.205.210"
#define MYSQL_USER              "***"
#define MYSQL_DB                "***"
#define MYSQL_PASS              "***"
stock SpojiSeSaBazom()
{
    if(mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS)) print("Spajanje sa MySQL bazom je uspesno!");
    else print("Spajanje sa MySQL bazom nije uspelo...");
}


main()
{
    SpojiSeSaBazom();
    mysql_debug(1);
}

Note: I have not changed anything in gamemode!
Note 2: All data are correct!


Re: MySQL connecting problem - andruz99 - 08.07.2011

Maybe mysql doesnt accept wierd characters as

#define MYSQL_USER "***"
#define MYSQL_DB "***"
#define MYSQL_PASS "***"

and when your running on localhost then host should be localhost, depends are you hosting on local or external.


Re: MySQL connecting problem - Jochemd - 09.07.2011

Quote:
Originally Posted by andruz99
View Post
Maybe mysql doesnt accept wierd characters as

#define MYSQL_USER "***"
#define MYSQL_DB "***"
#define MYSQL_PASS "***"

and when your running on localhost then host should be localhost, depends are you hosting on local or external.
This is censored, of course.

Are you sure you database exists?


Re: MySQL connecting problem - Hal - 10.07.2011

Make sure you can login to the database with myphpadmin (or whatever) with that info.


Re: MySQL connecting problem - Vince - 10.07.2011

This is most likely a host problem. Lately someone had the same error (2003) which was caused by the host forgetting to open the ports in the firewall.