MySQL connecting problem
#1

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!
Reply
#2

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.
Reply
#3

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?
Reply
#4

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)