SA-MP Forums Archive
MySQL why closes connection ... - 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: MySQL why closes connection ... (/showthread.php?tid=315795)



MySQL why closes connection ... - Tigerkiller - 04.02.2012

Hello guys since ive changed my gm it works correctly BUT after some times the connection closed but i only close the connection on server gmx

i have to restart the server to get my gm back working. it cant be my root.

i use strickenkid's plugin and OnGameModeInit is this:

pawn Код:
mysql_init(LOG_ONLY_ERRORS);
    mysql_connect(host,user,pass,db);

is there a reconnect code ?

//edit anyone else ?


Re: MySQL why closes connection ... - Scenario - 04.02.2012

Could it be your database closing the connection? If you can, check the log for the actual MySQL server...

Otherwise, it's probably a query you have running that's causing the connection to terminate. It's best to log everything, especially when debugging things like this. Check your server logs and see if something stands out to you!


AW: MySQL why closes connection ... - Tigerkiller - 04.02.2012

there is nothing wrong i free results after quering and using the results


Re: AW: MySQL why closes connection ... - Scenario - 04.02.2012

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
there is nothing wrong i free results after quering and using the results
Quote:

i have to restart the server to get my gm back working

Are you sure there's nothing wrong?

Did you even care to check the logs? I'm not going to help someone who is so arrogant they won't even try doing what I said!


AW: MySQL why closes connection ... - Tigerkiller - 04.02.2012

allready did! my problem is only this that the connection closes


Re: AW: MySQL why closes connection ... - Scenario - 04.02.2012

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
allready did! my problem is only this that the connection closes
It's either the database closing the connection, or you're executing queries which are causing the connection to terminate.


AW: MySQL why closes connection ... - Tigerkiller - 04.02.2012

hmm iam gonna check over 50 queries now.

and it cant be the root because i tested it on samp4you and gta-servers

iam going to response tomorrow with the result and iam going to check the wiki for the plugin too


Re: AW: MySQL why closes connection ... - Scenario - 04.02.2012

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
hmm iam gonna check over 50 queries now.
You don't have to check every single query you have, unless you wrote your entire mode without testing everything! Just check the queries you wrote last and you'll probably find your mistake(s). If you had a decent logging system (i.e. with BlueG's plugin), it would be simple for you to find the problem queries.