[英]MySQL server has gone away
我一直在進行數據查詢,它將使用給定的參數從表中選擇一條記錄。
當它在localhost中使用時,它一直運行良好,但是在上載和在生產站點中使用時,它將引發錯誤。
請看看錯誤
exception 'CDbException' with message 'CDbCommand failed to execute the SQL
statement: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away.
The SQL statement executed was: SELECT id from MST_PERSON WHERE last_name =
'name' and first_name = 'name' and middle_name = 'name' and
birth_date = 'date' limit 1 '
我試過增加sql的wait_timeout,但是沒有運氣。
提前致謝。
編輯您的my.cnf
..如果是Linux,則需要使用: vim /etc/mysql/my.cnf
加:
max_allowed_packet=500M
然后restart mysql
我在Google中看到了問題,它說更改my.cnf wait_timeout = 28800
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.