mysql提示got timeout reading communication packets的解決方法
錯誤提示:
user: 'root' host: `localhost' (Got timeout reading communication packets)
MYSQL server has gone away
引起這個原因是不可怕的.原因是更改了系統(tǒng)的斷開時間.
mysql>show gloable variables like "%timeout%";
進行查看
interactive_timeout 的黓認值為28800
wait_timeout 的默認值這:120
根據(jù)情況增加吧.
這兩個值是一個全局變量,可以動態(tài)增加,如:
mysql> set global interactive_timeout=28800;
Query OK, 0 rows affected (0.00 sec)
mysql> show global variables like "interactive_timeout";
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| interactive_timeout | 28800 |
+---------------------+-------+
1 row in set (0.00 sec)
可以導致Got timeout reading communication packets錯誤的原因
https://dev.mysql.com/doc/refman/5.5/en/communication-errors.html
可能導致Got Timeout reading communication packets錯誤的原因有如下幾個:
A client attempts to access a database but has no privileges for it.(沒有權(quán)限)
A client uses an incorrect password.(密碼錯誤)
A connection packet does not contain the right information.(連接沒有包含正確信息)
It takes more than connect_timeout seconds to obtain a connect packet. (獲取連接信息起過connect_timeout的時長)
The client program did not call mysql_close() before exiting.(客戶端沒有調(diào)用mysql_close()函數(shù))
The client had been sleeping more than wait_timeout or interactive_timeout seconds without issuing any requests to the server. (客戶端的空連接時間過長,超過了wait_timeout和interactive_timeout的時間)
The client program ended abruptly in the middle of a data transfer.(數(shù)據(jù)傳輸過程中終結(jié))
錯誤排查:
因為我們手機版與pc端的php函數(shù)不同步導致的問題,所以仔細檢查一下問題就解決了。
相關(guān)文章
Mysql查看最大連接數(shù)和修改最大連接數(shù)的講解
今天小編就為大家分享一篇關(guān)于Mysql查看最大連接數(shù)和修改最大連接數(shù)的講解,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2019-03-03
MySQL自動填充create_time和update_time的兩種方式
當我們創(chuàng)建業(yè)務表的時候 通常都需要設(shè)置create_time 和 update_time,下面這篇文章主要給大家介紹了關(guān)于MySQL自動填充createTime和updateTime的兩種方式,需要的朋友可以參考下2022-05-05
基于ubuntu中使用mysql實現(xiàn)opensips用戶認證的解決方法
本篇文章小編為大家介紹,基于ubuntu中使用mysql實現(xiàn)opensips用戶認證的解決方法。需要的朋友參考下2013-04-04
mysql 關(guān)鍵詞相關(guān)度排序方法詳細示例分析
以下是對mysql關(guān)鍵詞相關(guān)度排序方法進行了詳細的分析介紹,需要的朋友可以過來參考下2013-08-08
select?into?from和insert?into?select的區(qū)別舉例詳解
這篇文章主要介紹了SQL中的SELECT?INTO和INSERT?INTO?SELECT兩種語句的區(qū)別和用法,SELECT?INTO用于創(chuàng)建新表并復制數(shù)據(jù)到新表中,而INSERT?INTO?SELECT用于將數(shù)據(jù)從一個表插入到已存在的另一個表中,需要的朋友可以參考下2025-03-03

