매일 다음과 같은 메시지가 나타납니다. 내 스크립트는 cron 작업을 통해 실행됩니다. 누구든지이 문제를 해결할 수 있습니까?MySQL 서버가 없어졌습니다 - Python
File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away')
내 코드 :
def get_id(test_mysql_conn,id):
cursor = test_mysql_conn.cursor()
cursor.execute("""select id from test where id = %s """, (id))
row = cursor.fetchone()
if row is not None:
return row[0]
return 0
이 답변을보십시오 : http://stackoverflow.com/a/982873/974317 –
[this] (http://dev.mysql.com/doc/refman/5.0/en/gone-away.html). –
자세한 내용은 최대 패킷 크기를 초과 할 때이 오류가 발생할 수 있습니다. [here] (http://serverfault.com/a/528183/341327) – PlasmaBinturong