MySQL database connection gets lost
#1

So after a while my server loses MySQL connection.

This is the last thing in MySQL log:
Код:
[14:18:06] [DEBUG] CMySQLQuery::Execute[OnAccountRegister(i)] - starting query execution
[14:18:06] [DEBUG] CMySQLQuery::Execute[OnAccountRegister(i)] - query was successful
[14:18:06] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[14:18:06] [DEBUG] CMySQLQuery::Execute[OnAccountRegister(i)] - data being passed to ProcessCallbacks()
[14:18:06] [DEBUG] Calling callback "OnAccountRegister"..
[14:18:06] [DEBUG] cache_insert_id - connection: 1
[14:18:06] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[14:18:06] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
So I made a command to connect to the database again:
Код:
mysql = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
	return 1;
But that wont do anything, the login/register dialog still wont be shown.

14:18 was the last MySql event, after that none of the logins/registers worked, even after I reconnect DB at 14:53:

Код:
[14:53:18] [DEBUG] mysql_connect - host: "127.0.0.1", user: "XXXX", database: "XXXX, password: "****", port: 3306, autoreconnect: true
[14:53:18] [WARNING] CMySQLHandle::Create - connection already exists
[14:53:18] [DEBUG] CMySQLConnection::Connect - connection was successful
[14:53:18] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[14:53:18] [DEBUG] CMySQLConnection::Connect - connection was successful
[14:53:18] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
So after some time (this case 14:18) database stop working, login system not working, nothing printed in MySQL log when I try to login after that. Even when connect database 14:53, still nothing printed to log when try register or anything.. How to fix?
Reply
#2

When restart server starts working again!
Reply
#3

Maybe you're sending a query somewhere in your script causing either an internal error in the plugin or rather MySQL to not respond to your server / the plugin.

Is there anything specific that happens in the server_log right before everything stops working?
Reply
#4

Or perhaps the connection is idling for too long and is simply shutting off. You'll have to keep the connection fresh by periodically sending queries or something.
Reply
#5

Are you 100% sure the database service has crashed? Because there is nothing in that log that shows that the service actually shut down.
Reply
#6

Your login system might be the issue, have a look at it or send us some snippets.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)