Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
116 views
in Q2A Core by
retagged by

I keep getting this error, What could it be? How I debug it?

[17-Oct-2024 07:32:52 Etc/GMT-3] PHP Question2Answer MySQL connect error 2006: MySQL server has gone away
[17-Oct-2024 07:32:52 Etc/GMT-3] PHP Question2Answer MySQL connect error 2006: MySQL server has gone away
[17-Oct-2024 07:32:52 Etc/GMT-3] PHP Question2Answer MySQL connect error 2006: MySQL server has gone away
[17-Oct-2024 07:32:52 Etc/GMT-3] PHP Question2Answer MySQL connect error 2006: MySQL server has gone away
[17-Oct-2024 07:32:52 Etc/GMT-3] PHP Question2Answer MySQL connect error 2006: MySQL server has gone away
[18-Oct-2024 10:43:39 Etc/GMT-3] PHP Question2Answer MySQL connect error 2002: Resource temporarily unavailable
[18-Oct-2024 10:43:54 Etc/GMT-3] PHP Question2Answer MySQL connect error 2002: Resource temporarily unavailable
[20-Oct-2024 05:00:09 Etc/GMT-3] PHP Question2Answer MySQL connect error 2002: Resource temporarily unavailable
[21-Oct-2024 05:00:08 Etc/GMT-3] PHP Question2Answer MySQL connect error 2002: Resource temporarily unavailable

1 Answer

0 votes
by

Appears to be a MySQL server configuration, according to this answer:


I have encountered this a number of times and I've normally found the answer to be a very low default setting of  max_allowed_packet .

Raising it in  /etc/my.cnf  (under  [mysqld] ) to 8 or 16M usually fixes it. (The default in MySql 5.7 is  4194304 , which is 4MB.)

[mysqld]
max_allowed_packet=16M

Note: Just create the line if it does not exist, it must appear as an entry underneath  [mysqld] 

Note: This can be set on your server as it's running but it will be lost after the mysql daemon is restarted. Use  SET GLOBAL max_allowed_packet=104857600  (this sets it to 100MB)

Note: On Windows you may need to save your my.ini or my.cnf file with ANSI not UTF-8 encoding.


Source: stackOverflow.

by
I don't think so, I checked the file /etc/my.cnf  
and it is:
max_allowed_packet = 1G

I have only 5k questions and 4k answers
...