07.05.2014, 11:36
Hello,
There is my code:
So, I try to connect my server to my database on my computer (using wamp).
But, my server say all time that the connection has been established while my database server is off...
There is the mysql debug log:
SQL SERVER OFF:
SQL SERVER ON:
Logs are good...
Regards
There is my code:
Код:
#define MYSQL_HOST "localhost" #define MYSQL_USER "root" #define MYSQL_PASS "" #define MYSQL_DB "larp2" forward MySQLConnect(sqlhost[], sqluser[], sqldb[], sqlpass[]); MySQLConnect(MYSQL_HOST,MYSQL_USER,MYSQL_DB,MYSQL_PASS); public MySQLConnect(sqlhost[], sqluser[], sqldb[], sqlpass[]) { print("Connexion а la base de donnйes..."); // Connecting to the database if(mysql_connect(sqlhost,sqluser,sqldb,sqlpass)) { print("Connexion а la base de donnйes rйussie."); // success return 1; } else { print("Connexion а la base de donnйes йchouйe."); // !success if(mysql_connect(sqlhost,sqluser,sqldb,sqlpass)) { print("Connexion а la base de donnйes rйtablie."); // success return 1; } else { print("Connexion а la base de donnйes perdue. Le serveur est eteint."); // close server SendRconCommand("exit"); return 0; } } }
But, my server say all time that the connection has been established while my database server is off...
There is the mysql debug log:
SQL SERVER OFF:
Код:
[13:44:51] CMySQLHandler::CMySQLHandler() - constructor called. [13:44:51] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "larp2" | Username: "root" ... [13:44:52] CMySQLHandler::Connect() - Can't connect to MySQL server on 'localhost' (10061) (Error ID: 2003)
Код:
[13:42:29] CMySQLHandler::CMySQLHandler() - constructor called. [13:42:29] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "larp2" | Username: "root" ... [13:42:29] CMySQLHandler::Connect() - Connection was successful. [13:42:29] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
Regards