MySQL 报错 Forcing close of thread 139 user: 'root'

老牛浏览 494评论 0发表于

最近重启服务器的 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] 下添加:

ini
skip-name-resolve

Windows 系统

修改 MySQL 的配置文件 my.ini 在 [mysqld] 下添加:

ini
skip-locking
skip-name-resolve

修改完成后,重启 MySQL 服务即可。

点赞
收藏
暂无评论,快来发表评论吧~
私信
老牛@ilaoniu
老牛,俗称哞哞。单纯的九零后理工小青年。喜欢折腾,爱玩,爱音乐,爱游戏,爱电影,爱旅游...
最后活跃于