Mysql error :(
#1

Код:
[11:13:59]  Can't connect to MySQL Database | Trying Again !
[11:14:00] Can't connect to MySQL Database | Server Closed !
.....
  > MySQL plugin unloaded.
Anyone can help me?
Reply
#2

show your portion code where you try to connect at database.
Reply
#3

Код:
#define SQL_HOST   "127.0.0.1"
#define SQL_USER   "root"
#define SQL_PASS   ""
#define SQL_DATA   "dayzdb"
Reply
#4

Are you sure that's your db name and such? try putting it as localhost instead of 127.0.0.1

E: Do you have PHPMyAdmin open?
Reply
#5

Quote:
Originally Posted by Sparke
Посмотреть сообщение
Are you sure that's your db name and such? try putting it as localhost instead of 127.0.0.1

E: Do you have PHPMyAdmin open?
Doesn't work
Reply
#6

pawn Код:
new db_connect;

//OnGameModeInit()..

db_connect = mysql_connect("localhost","root","dayzdb","");
Try this without define costants..
Reply
#7

Quote:
Originally Posted by Galletziz
Посмотреть сообщение
pawn Код:
new db_connect;

//OnGameModeInit()..

db_connect = mysql_connect("localhost","root","dayzdb","");
Try this without define costants..
I get 4 errors.
Reply
#8

What errors? :\
Reply
#9

Quote:
Originally Posted by Galletziz
Посмотреть сообщение
What errors? :\
Код:
C:\Users\Andrijana\Desktop\HDRP\gamemodes\dayzstandalone.pwn(2011) : error 010: invalid function or declaration
C:\Users\Andrijana\Desktop\HDRP\gamemodes\dayzstandalone.pwn(3484) : error 017: undefined symbol "SQL_HOST"
C:\Users\Andrijana\Desktop\HDRP\gamemodes\dayzstandalone.pwn(3492) : error 017: undefined symbol "SQL_HOST"
C:\Users\Andrijana\Desktop\HDRP\gamemodes\dayzstandalone.pwn(3896) : warning 203: symbol is never used: "db_connect"
Код:
3492:        mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
3484:     mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
203: }
2011: db_connect = mysql_connect("localhost","root","dayzdb","");

stock Connect_To_Database(){
    mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
    if(mysql_ping() == 1){
        print("[DayZ - MySQL] Connect to MySQL Database successfully !");
        return true;
	}
    else
    {
        print("[DayZ - MySQL] Can't connect to MySQL Database | Trying Again !");
        mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
        if(mysql_ping() == 1){
            print("[DayZ - MySQL] Connect to MySQL Database successfully !");
            return true;
        }
        else{
			print("[DayZ - MySQL] Can't connect to MySQL Database | Server Closed !");
            SendRconCommand("exit");
            return true;
        }
    }
}
Reply
#10

I have no errors in Pawno but it still fails to connect to Mysql database.
I fixed those.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)