[17:05:27] >> mysql_connect( ) [17:05:27] CMySQLHandler::CMySQLHandler() - constructor called. [17:05:27] CMySQLHandler::CMySQLHandler() - Connecting to "127.0.0.1" | DB: "database" | Username: "root" ... [17:05:28] CMySQLHandler::Connect() - Can't connect to MySQL server on '127.0.0.1' (10061) (Error ID: 2003)
#define MySQL_HOST "127.0.0.1" #define MySQL_USER "root" #define MySQL_DATA "database" #define MySQL_PASS ""
mysql_debug( true ); mysql_connect( MySQL_HOST,MySQL_USER,MySQL_DATA,MySQL_PASS ); if( mysql_ping( ) >= 1 ) { print( "Prisijungeme prie MySQL sekmingai!" ); } else { SendRconCommand( "exit" ); }
The error (2003) Can't connect to MySQL server on 'server' (10061) indicates that the network connection has been refused. You should check that there is a MySQL server running, that it has network connections enabled, and that the network port you specified is the one configured on the server. |
mysql_connect(MySQL_HOST, MySQL_USER, MySQL_DATA, MySQL_PASS);
if(mysql_ping() == 1) {
mysql_debug(1);
} else {
SendRconCommand( "exit" );
}
#define MySQL_HOST "localhost"
#define MySQL_USER "root"
#define MySQL_DATA "database"
#define MySQL_PASS ""