MySQL Connection
#1

Okay, My Server is hosted on this ip : server.ip.here
My Website & SQL server are here: website.sql.ip
I connect via mysql_connect("website.sql.ip","user","password"," db");
But on the logs it fails to connect and shows this:
Acces denied. 'user@server.ip.here', meaning that its connecting to localhost instead of the IP of my sql server.Why is this?
Reply
#2

BUMP, I still need help.For some reason its connecting to my localhost instead of the IP
Reply
#3

How can we help you with you showing us code? Show your connection defines (if you have them) and the mysql_connect(); under OnGameModeInit().
Reply
#4

You probably you MySQL plugin? Go and post in its topic
Reply
#5

Im using StrickenKid's Here is on Gamemode init:
pawn Код:
mysql_init();
    if(!mysql_connect("localhost", "rayyan","lolk","rayyan_westside"))
    {
       print("\n MySQL Connection Failed, Now on Offline Mode\n");
       Offline = 1;
       mysql_close();
    }
    else
    {
      SetTimer("ServerUpdate",120000, true);
      Offline = 0;
    }
    SetGameModeText("WS-RPG2");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       BankTimer = SetTimerEx("BankCheck", 1000, true, "i", i);
       timetimer = SetTimerEx("TimeUpdate", 60000, true, "i", i);
       SetTimer("LoadCars", 2500, false);
       //SetTimerEx("IsAtGasStation",2000,1,"i",i);
    }
Compiled fine, just 24 loose indention warnings on my add static vehicles.
Reply
#6

Okay I'm a retard, Resolved.I didnt edit the localhost, Epic Fail.
Reply
#7

Reply
#8

Heheh.
Well now, i checked and the SQL Connects, but on my server console it says Error: mysql has gone away.Why does it keep loosing connection?How can i prevent this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)