SphereCommunity
56b mysql - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: 56b mysql (/Thread-56b-mysql)

Pages: 1 2


56b mysql - nori4 - 09-13-2017 08:39 PM

Hello Guys,

I got issue with MySQL and cant understand what is going on wrong.
May be someone can help me with that?

sphereserver and mysql is located on different pc.
sometimes connection is lost and i dont understand why.
i tried two ways
keep connection all on the time and another way close every time after session
but not happen and again come to the begging with

ERROR:MySQL server link has been lost. Trying to reattach to it

version is Sphere Version 0.56b [WIN32] by http://www.sphereserver.com, compiled at Sep 20 2009 (20:00:04)

may be someone have issue with that?

thanks guys


RE: 56b mysql - darksun84 - 09-13-2017 08:56 PM

Check this
https://dev.mysql.com/doc/refman/5.7/en/error-lost-connection.html


RE: 56b mysql - nori4 - 09-15-2017 04:35 AM

thanks i will try another way with additional check may be it will helps
thank you one more


RE: 56b mysql - nori4 - 09-20-2017 07:50 PM

when i use db.connect

12:45:(added_funcions.scp,2444)'INFORM' db for Record
12:47:CRITICAL:(added_funcions.scp,2445)'Main' thread hang, restarting...

[function mysql_open_connection]
IF !(<DB.CONNECTED>)
serv.log 'INFORM' db for Record
DB.CONNECT --- 2445 line
ENDIF

whats wrong?

Sphere Version 0.56b [WIN32] by http://www.sphereserver.com, compiled at Sep 20 2009 (20:00:04)

libmysql.dll have last update from sphereserver and also have used old one size 4.5mb and 1.1mb

i have 7 update for one time when player login may be it for that?


RE: 56b mysql - darksun84 - 09-20-2017 07:58 PM

'Main' thread hang, restarting...

This error often happens when Sphere enters in an "infinite" loop


RE: 56b mysql - nori4 - 09-20-2017 08:05 PM

now i have split on two cycle for update base i hope may be it will helps.

so, if i understand clear that may happen for 7 update in one time?


RE: 56b mysql - darksun84 - 09-20-2017 08:10 PM

Can you post the update script?


RE: 56b mysql - nori4 - 09-20-2017 08:12 PM

i see that i have missed one dbghelp.dll that dll important or not and for what needed?

yeah of course
Code:
[FUNCTION mysql_classes]
if (<tag0.points> < 10000)
return 1
endif

IF !(<DB.CONNECTED>)
serv.log 'WARNING' DB connection is lost and function is stopped. waiting re-connect.
return 1
ENDIF

DB.QUERY "SELECT `uid` FROM `classes` WHERE `uid`='<UID>'"
IF (<DB.ROW.NUMROWS> > 0)
    DB.EXECUTE "UPDATE classes SET name='<DB.escapedata <skillclass.name>>' WHERE uid='<UID>'"
ELSE
    DB.EXECUTE "INSERT INTO `classes` (`name`,`uid`) VALUES ('<DB.escapedata <skillclass.name>>', '<UID>')"
ENDIF

[FUNCTION mysql_dueling]
if !(<dtag0.dueling_w>)
return 1
endif

IF !(<DB.CONNECTED>)
serv.log 'WARNING' DB connection is lost and function is stopped. waiting re-connect.
return 1
ENDIF
DB.QUERY "SELECT `uid` FROM `dueling` WHERE `uid`='<UID>'"
IF (<DB.ROW.NUMROWS> > 0)
    DB.EXECUTE "UPDATE dueling SET name='<DB.escapedata <name>>', deaths='<dtag0.dueling_d>', win='<dtag0.dueling_w>' WHERE uid='<UID>'"
ELSE
    DB.EXECUTE "INSERT INTO `dueling` (`name`,`uid`, `deaths`, `win`) VALUES ('<DB.escapedata <name>>', '<UID>', '<dtag0.dueling_d>', '<dtag0.dueling_w>')"
ENDIF

and i got like this 7 update


RE: 56b mysql - darksun84 - 09-21-2017 01:53 AM

So in the insert no errors?


RE: 56b mysql - nori4 - 09-21-2017 04:05 AM

nope
works fine
i have mysql on different host and sphere also
may be problems is for thaT?