SA-MP Forums Archive
Problem with mysql - 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: Problem with mysql (/showthread.php?tid=469517)



Problem with mysql - MindaugasL - 13.10.2013

Hello guys.I have problem,when my GameMode connecting to mysql.When it try to connect,I get this:
PHP код:
[20:15:05] >> mysql_connect( )
[
20:15:05CMySQLHandler::CMySQLHandler() - constructor called.
[
20:15:05CMySQLHandler::CMySQLHandler() - Connecting to "localhost" DB"samp15385" Username"samp15385" ...
[
20:15:05CMySQLHandler::Connect() - Access denied for user 'samp15385'@'localhost' (using passwordYES) (Error ID1045
GameMode mysql code:
PHP код:
public OnGameModeInit()
{
    
mysql_debugtrue );
    
mysql_connect(MySQL_HOST,MySQL_USER,MySQL_DATA,MySQL_PASS);
    if( 
mysql_ping( ) >= )
    {
        print( 
"Connected to mysql succsesfull" );
    }
    else
    {
        print( 
"Connected to mysql failed" );
    }
    for(new 
p=0p<MAX_STREAMED_OBJECTp++)
    {
        
myobject[p] = -1;
    } 
PHP код:
#define MySQL_HOST "127.0.0.1"
#define MySQL_USER "samp2514"
#define MySQL_DATA "samp2514"
#define MySQL_PASS "karoce" 
Can say to me whats wrong?


Re: Problem with mysql - gtakillerIV - 13.10.2013

Are you sure that your MySQL username and password are correct? You might wanna try "root" as username and without a password(leave the password empty "").


Re: Problem with mysql - MindaugasL - 13.10.2013

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
Are you sure that your MySQL username and password are correct? You might wanna try "root" as username and without a password(leave the password empty "").
Yes,it correct.I have a samp server host,maybe my gamemode needs VPS?


Re: Problem with mysql - Konstantinos - 13.10.2013

Quote:
Originally Posted by MindaugasL
Посмотреть сообщение
Yes,it correct.I have a samp server host,maybe my gamemode needs VPS?
If you're on a host, use their details.


Re: Problem with mysql - MindaugasL - 13.10.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
If you're on a host, use their details.
I using their detail's,but it same problem :/ Can u help me?


Re: Problem with mysql - Konstantinos - 13.10.2013

Quote:
Originally Posted by MindaugasL
Посмотреть сообщение
I using their detail's,but it same problem :/ Can u help me?
No, you're not. I can see "127.0.0.1" (which is localhost) as the host while it should be an IP (of the host or some dns name).


Re: Problem with mysql - DanishHaq - 13.10.2013

Drop your host a ticket and ask them whether or not the IP of the MySQL database will be called locally in regards to your server IP, because sometimes they put the SQL database on the same server as your current IP too, if that's the case then you use "localhost" as your host. Otherwise, you need to change that as said above in Konstantinos' post.


Re: Problem with mysql - iJumbo - 15.10.2013

And you have already tryed to use your server ip instead of localhost one?