Can't connect to mysql host
#1

Well I can't connect to my host.
Is something wrong?

Код:
#define mysql_host             "s1.hostingtime.de"//the IP of the host, should be displayed when created a database
#define mysql_user             "db223"//database username
#define mysql_password         "secret :D"//database password
#define mysql_database         "db223"//database name
Код:
public OnFilterScriptInit()
{
	print("DutchAdmin System has loaded!");
 	mysql_debug(1);
	for(new x = 0; x < 3; x++)
	{
	    mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
	    if(mysql_ping() == -1) printf("MySQL connection attempt %d failed!", x);
	    else
		{
		    print("succes");
			break;
		}
	}
	format(Query,sizeof(Query), "CREATE TABLE IF NOT EXISTS `Users` ("\
              "`Username` varchar(24) NOT NULL,"\
              "`Password` varchar(64) NOT NULL,"\
              "`IP` varchar(16) NULL,"\
              "`Money` int(15) NULL,"\
              "`Score` int(15) NULL,"\
              "`Kills` int(15) NULL,"\
              "`Deaths` int(15) NULL,"\
              "`Viplevel` int(15) NULL,"\
              "`Adminlevel` int(15) NULL,"\
              "`Banned` int(15) NULL,"\
              "PRIMARY KEY (`Username`)"\
           );
    mysql_query(Query);
    mysql_free_result();
	return 1;
}
Reply
#2

either your username, password, database, or hostname is wrong.

or there is a firewall.

take your pick
Reply
#3

What does your mysql log print?
Reply
#4

[15:19:09] ---------------------------

[15:19:09] MySQL Debugging activated (09/30/11)

[15:19:09] ---------------------------

[15:19:09]

[15:19:09] >> mysql_connect( )

[15:19:09] CMySQLHandler::CMySQLHandler() - constructor called.

[15:19:09] CMySQLHandler::CMySQLHandler() - Connecting to "s1.hostingtime.de" | DB: "db223" | Username: "db223" ...

[15:19:10] CMySQLHandler::Connect() - Can't connect to MySQL server on 's1.hostingtime.de' (10061) (Error ID: 2003)

[15:19:10] >> mysql_ping( Connection handle: 1 )

[15:19:10] CMySQLHandler::Ping() - You cannot call this function now. (Reason: Dead Connection)

[15:19:10] >> mysql_connect( )

[15:19:11] CMySQLHandler::Connect() - Can't connect to MySQL server on 's1.hostingtime.de' (10061) (Error ID: 2003)

[15:19:11] >> mysql_ping( Connection handle: 1 )

[15:19:11] CMySQLHandler::Ping() - You cannot call this function now. (Reason: Dead Connection)

[15:19:11] >> mysql_connect( )

[15:19:12] CMySQLHandler::Connect() - Can't connect to MySQL server on 's1.hostingtime.de' (10061) (Error ID: 2003)

[15:19:12] >> mysql_ping( Connection handle: 1 )

[15:19:12] CMySQLHandler::Ping() - You cannot call this function now. (Reason: Dead Connection)

[15:19:12] >> mysql_query( Connection handle: 1 )

[15:19:12] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)

[15:19:12] >> mysql_free_result( Connection handle: 1 )

[15:19:12] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead)
Reply
#5

pawn Код:
#define mysql_host             "s1.hostingtime.de"//the IP of the host, should be displayed when created a database
#define mysql_user             "db223"//database username
#define mysql_password         "secret :D"//database password
#define mysql_database         "db223"//database name
Bad settings.

Код:
[15:19:11] CMySQLHandler::Connect() - Can't connect to MySQL server on 's1.hostingtime.de' (10061) (Error ID: 2003)
Reply
#6

Use for the mysql_host: localhost

And check your Password in the Settings!

Best Regards

F. Richter

HostingTime.de
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)