MySQL Don't Connect
#1

Hello People,

I'm creating a server, but it don't work.
The MySQL Connection fails.. Can anyone view my problem?


Код:
#define SQL_HOST "149.210.128.9"
#define SQL_USER "gepestword_strcm"
#define SQL_PASS "(SECRET :D)"
#define SQL_DB 	 "gepestword_strcm"

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

public OnGameModeInit()
{
	mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
 	if(mysql_ping() == -1) printf("MySQL connection attempt %d failed!");
  	else
	{
 		print("succes");
	}
	
    mysql_query("CREATE TABLE IF NOT EXISTS LSRPUsers(user VARCHAR(24), password VARCHAR(40), score INT(20), money INT(20), level INT(20), vip INT(20), kma INT(20), rank INT(20), kills INT(20), deaths INT(20), muted INT(20), jailed INT(20), frozen INT(20), mutedtimes INT(20), jailedtimes INT(20), frozentimes INT(20), banned INT(20), bannedby VARCHAR(24), logins INT(20), posx INT(20), posy INT(20), posz INT(20), posa INT(20), IP VARCHAR(15) )");
    mysql_debug(1);
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}
I allowed all connections in my webhost etc.
Website config works but SAMP can't connect to it.. Anyone know a solution??


SKYPE: Gilian.Abels
Greetz Gilian,
Reply
#2

MySQL_Debug.txt?
Reply
#3

Some connections disallow remote connections to the MySQL server, try this.

pawn Код:
#define SQL_HOST "127.0.0.1"
Reply
#4

No it's not 127.0.0.1, its an external webhost. But he don't connect, all things work...
My Mysql debug.txt? Here
Quote:

[16:55:45]

[16:55:45] ---------------------------

[16:55:45] MySQL Debugging activated (12/19/13)

[16:55:45] ---------------------------

[16:55:45]

[16:56:44]

[16:56:44] ---------------------------

[16:56:44] MySQL Debugging activated (12/19/13)

[16:56:44] ---------------------------

[16:56:44]

[03:25:39]

[03:25:39] ---------------------------

[03:25:39] MySQL Debugging activated (12/20/13)

[03:25:39] ---------------------------

[03:25:39]
Nothing wrong, isn't?
Reply
#5

Did you try it out first? Most of the time, when the IP of the SQL server matches with the server's IP, then you can simply use "127.0.0.1" to connect to it remotely.
Reply
#6

No we have one VPS and one webhost, its not the same IP ...
Reply
#7

Is database from website ?
Reply
#8

On the webhost I assume you're running cPanel so go there and go to allow remote mysql, then enter your VPS ip.

Even better just run the Mysql database on your VPS.
Reply
#9

But i wan't to connect the server with my site, register via website? Than automaticly registered in server... And i use DirectAdmin, i filled in % (allowed all connections).. But nothing work..
Reply
#10

Quote:

I allowed all connections in my webhost etc.
Website config works but SAMP can't connect to it.. Anyone know a solution??


SKYPE: Gilian.Abels
Greetz Gilian,

Some WEBhosts won't allow remote connections for security reasons. I tried to host a database with HostGator for example, it wouldn't allow the connections. I finally called them, and they stated that it doesn't allow outside connections.

So if you're hosting a database through a webhosting company, ask them if they allow remote connections to the database.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)