標籤:伺服器 mysql 假死
最近重啟伺服器的mysql總是報大量的如下錯誤:
160330 9:14:26 [Warning] /usr/libexec/mysqld: Forcing close of thread 139 user: ‘root‘160330 9:14:26 [Warning] /usr/libexec/mysqld: Forcing close of thread 138 user: ‘root‘160330 9:14:26 [Warning] /usr/libexec/mysqld: Forcing close of thread 137 user: ‘root‘160330 9:14:26 [Warning] /usr/libexec/mysqld: Forcing close of thread 136 user: ‘pdss‘160330 9:14:26 [Warning] /usr/libexec/mysqld: Forcing close of thread 131 user: ‘root‘160330 9:14:26 [Warning] /usr/libexec/mysqld: Forcing close of thread 130 user: ‘csm‘
這個錯誤其實是mysql在對DNS做反查,由於反查的接續速度過慢,大量的查詢處理不及時,線程得不到釋放,造成MySQL“ 假死”。
解決辦法:
linux伺服器
修改mysql的設定檔(my.cnf)在[mysqld]下添加:
skip-name-resolve
windows伺服器
修改mysql的設定檔(my.ini)在[mysqld]下添加:
skip-locking skip-name-resolve
修改完成後,重啟mysql服務。
本文出自 “Garany.Wang” 部落格,請務必保留此出處http://garany.blog.51cto.com/7342714/1758279
Mysql報錯Forcing close of thread 139 user: 'root'