报错内容:
modles:
my.cn中
max_allowed_packet=1024M
skip-name-resolve
还是经常出现(2013, 'Lost connection to MySQL server during query')这个错误
请问哪里出问题了,应该怎么修改呢
PHPz2017-04-18 10:26:01
It is recommended that when asking questions, try to post the error message and the error code instead of taking screenshots.
The error message indicates that the mysql connection is lost.
search_cursor = search_conn.cursor()
Seeing that your list_related function did not pass in the search_conn parameter, did you define it as a global variable? If this is the case, it is because mysql has a default connect_timeout time, which will automatically close the connection once it is exceeded.
You can try the following two methods:
Set the connect_timeout time when creating a connection and set it longer.
Every time you operate the database, a connection is established and closed after the operation is completed.
黄舟2017-04-18 10:26:01
Judging from your SQL statement, it is not well written. You need to study it carefully and make full use of indexes or third-party word segmentation systems