SA-MP Forums Archive
Trouble With Connecting MySql to UCP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Trouble With Connecting MySql to UCP (/showthread.php?tid=281932)



Trouble With Connecting MySql to UCP - Phoenix_Roleplay - 08.09.2011

Hi Everyone,

First off I was unsure of where to put this, so sorry if it's int he wrong place. I seem to be having a problem connecting MySql to my User Control Panel (UCP). The game host I am using is Serverffs. I created the database and entered all the information correctly but I can't seem to find out what's going on and need some help. Basically here is the message I am getting

Код:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '127.0.0.1' (10061) in D:\hosting\8291812\html\ucp\inc\classes\MySQLHandler.php on line 25
Can't connect to MySQL server on '127.0.0.1' (10061)
I am pretty sure I have everything right but I will provide the code for that above warning.

Code For Line 25:
Код:
$this->con = mysql_connect("127.0.0.1","XXXXXXX","XXXXXXXX","XXXXXXXX");
I have it all right I just used X for privacy.


Also here is the Config and that's all the information entered.

Код:
/****MySQL Configuration****/
$config['db_host'] = "127.0.0.1";
$config['db_user'] = "XXXX";
$config['db_pass'] = "XXXX";
$config['db_name'] = "XXXX"; 
$config['table_prefix'] = "samp_accounts";
I hope someone can help me, if you need more information let me know. Thanks


Re: Trouble With Connecting MySql to UCP - Willow - 08.09.2011

I don't know, but why you need con = mysql_connect(...); ?


Re: Trouble With Connecting MySql to UCP - Phoenix_Roleplay - 08.09.2011

I am using that code because basically that is what is used to create a connection to MySql.


Re: Trouble With Connecting MySql to UCP - Pinguinn - 08.09.2011

The problem is maybe because the UCP is not using IP 127.0.0.1


Re: Trouble With Connecting MySql to UCP - Phoenix_Roleplay - 08.09.2011

Quote:
Originally Posted by Pinguinn
Посмотреть сообщение
The problem is maybe because the UCP is not using IP 127.0.0.1
Well I was assuming it was 127.0.0.1 because that seems to be what ServerFFS is using at the host name. Did you have any suggestions?


Re: Trouble With Connecting MySql to UCP - MadeMan - 08.09.2011

Use your server IP.


Re: Trouble With Connecting MySql to UCP - Phoenix_Roleplay - 08.09.2011

Ok I'll try my server's I.P Address and tell the result to everyone.


Re: Trouble With Connecting MySql to UCP - Pinguinn - 08.09.2011

No, I've read the serverFFS forum and it seems that using IP 127.0.0.1 correct is
Try replacing
Код:
$this->con = mysql_connect("127.0.0.1","XXXXXXX","XXXXXXXX","XXXXXXXX");
with
Код:
$this->con = mysql_connect("127.0.0.1","XXXXXXX","XXXXXXXX","XXXXXXXX") or die(mysql_error());
Then tell the result


Re: Trouble With Connecting MySql to UCP - Phoenix_Roleplay - 08.09.2011

I still seem to be getting the same Warning

Код:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '127.0.0.1' (10061) in D:\hosting\8291812\html\ucp\inc\classes\MySQLHandler.php on line 25
Can't connect to MySQL server on '127.0.0.1' (10061)
And this is what I have on line 25 on that file:

pawn Код:
$this->con = mysql_connect("127.0.0.1","XXXX","XXXX","XXXX") or die(mysql_error());if($this->con)



Re: Trouble With Connecting MySql to UCP - MadeMan - 09.09.2011

Quote:
Originally Posted by Phoenix_Roleplay
Посмотреть сообщение
I still seem to be getting the same Warning

Код:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '127.0.0.1' (10061) in D:\hosting\8291812\html\ucp\inc\classes\MySQLHandler.php on line 25
Can't connect to MySQL server on '127.0.0.1' (10061)
And this is what I have on line 25 on that file:

pawn Код:
$this->con = mysql_connect("127.0.0.1","XXXX","XXXX","XXXX") or die(mysql_error());if($this->con)
You are still using 127.0.0.1 here.

Use the game server IP.