06.12.2016, 06:20
Hey guys. I want to do some testing on my local server so I don't have to keep uploading to the Dedicated server all the time however I keep getting errors (From my local server).
Basically long story short: I have a dedicated server that has a MySQL database linked to it. For the MySQL database information in the script is.
If I upload to the dedicated server and do anything with the database it works completely fine.
Then on my dedicated server I created a RemoteMySQL thing whatever it is. (I talked to the company and they said that's how you did it.) So I set the RemoteMySQL up setting it to my IP address. Then in the script I set the MYSQL_HOST to the dedicated server's IP address (no ports) and then when I tried to start up my server the connection failed and I got this error message.
I'm not sure if the fact that my local host is Windows and the dedicated server is Linux that's breaking it. Or just that I've set something up wrong. But here is my MySQL connection info in the script.
If you have any ideas please let me know.
Thanks for your time
Basically long story short: I have a dedicated server that has a MySQL database linked to it. For the MySQL database information in the script is.
Код:
#define MYSQL_HOST "127.0.0.1"
Then on my dedicated server I created a RemoteMySQL thing whatever it is. (I talked to the company and they said that's how you did it.) So I set the RemoteMySQL up setting it to my IP address. Then in the script I set the MYSQL_HOST to the dedicated server's IP address (no ports) and then when I tried to start up my server the connection failed and I got this error message.
Код:
(error #1042) Can't get hostname for your address
PHP код:
mysql_log(LOG_ALL, LOG_TYPE_HTML);
ServerMySQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS);
if(mysql_errno() != 0)
{
printf("[MySQL] The connection has failed.");
}
else
{
printf("[MySQL] The connection was successful.");
}
Thanks for your time