MYSQL Connection
#1

How do i setup this MYSQL because i can't connect/login to my server.

pawn Код:
// ( MySQL - Connection )
#if USE_LOCALHOST == true

#define LOCAL_HOST              "localhost"
#define LOCAL_USER              "root"
#define LOCAL_PASS              ""
#define LOCAL_DB                "asdas"

#else

#define SERVER_HOST             "localhost"
#define SERVER_USER             "root"
#define SERVER_PASS             ""
#define SERVER_DB               "asdas"

#endif
PLEASE HELP ME!
Reply
#2

Have you used mysql_connect anywhere?
Reply
#3

Yes here

pawn Код:
//============================== Connecting MySQL ========================//
    #if USE_LOCALHOST == false
    mysql_connect( SERVER_HOST, SERVER_USER, SERVER_DB, SERVER_PASS );
    print( ":: MySQL Conecting :: To '"SERVER_HOST"' as '"SERVER_USER"' to database '"SERVER_DB"'." );

    #else

    mysql_connect( LOCAL_HOST, LOCAL_USER, LOCAL_DB, LOCAL_PASS );
    print( ":: MySQL Conecting :: To '"LOCAL_HOST"' as '"LOCAL_USER"' to database '"LOCAL_DB"'." );
    #endif

    if ( mysql_ping ( ) != 1 )
    {
        #if USE_LOCALHOST == false
        print(":: MySQL :: Connecting to '"SERVER_HOST"' failed.");

        #else

        print(":: MySQL :: Connecting to '"LOCAL_HOST"' failed.");
        #endif

        //SendRconCommand( "exit" );
        //return false;
    }
    #if USE_LOCALHOST == false
    print(":: MySQL :: Connection to '"SERVER_HOST"' established.");
    print(":: MySQL :: Database '"SERVER_DB"' selected.");

    #else

    print(":: MySQL :: Connection to '"LOCAL_HOST"' established.");
    print(":: MySQL :: Database '"LOCAL_DB"' selected.");
    #endif
Reply
#4

And this is on OnGameModeInit, yes?
Reply
#5

Yea please help
Reply
#6

BUMP!!
Reply
#7

server log please?
Reply
#8

Server log ? i just want to ask how do i connect my sql ?
Reply
#9

Quote:
Originally Posted by ChuckyBabe
Посмотреть сообщение
Server log ? i just want to ask how do i connect my sql ?
PHP код:
public OnGameModeInit()
{
    
#if USE_LOCALHOST == 1
    
dbHandle mysql_connect(LOCAL_HOST,LOCAL_USER,LOCAL_DB,LOCAL_PASS);
    
#else
    
dbHandle mysql_connect(SERVER_HOST,SERVER_USER,SERVER_DB,SERVER_PASS);
    
#endif

Reply
#10

Quite sure this is an SEv2 gamemode. This is why some people fail while they don't know how it works..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)