Problem with mysql
#1

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?
Reply
#2

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 "").
Reply
#3

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?
Reply
#4

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.
Reply
#5

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?
Reply
#6

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).
Reply
#7

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.
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)