香水电影完整版在线观看未删减|久草在线国产|欧美伊人电影|美女福利视频在线,大开色戒完整版迅雷,久艹久,动画片大尺度未删减电影

軟件開發(fā),網(wǎng)站建設(shè),微信小程序制作,抖音小程序開發(fā),湖北紅點(diǎn)科技有限公司

點(diǎn)

態(tài)

業(yè)

軟件開發(fā),網(wǎng)站建設(shè),微信小程序制作,抖音小程序開發(fā),湖北紅點(diǎn)科技有限公司
Mysql假死如何解決
發(fā)布時間:2024-12-09  閱讀量:404

1、Mysql報錯Forcing close of thread 139 user: 'root'


最近重啟服務(wù)器的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做反查,由于反查的接續(xù)速度過慢,大量的查詢處理不及時,線程得不到釋放,造成MySQL“ 假死”。


解決辦法:


linux服務(wù)器

修改mysql的配置文件(my.cnf)在[mysqld]下添加:

skip-name-resolve

windows服務(wù)器

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

    skip-locking
  skip-name-resolve


修改完成后,重啟mysql服務(wù)。

2、優(yōu)化MySQL開啟skip-name-resolve參數(shù)時顯示“ignored in --skip-name-resolve mode.”Warning解決方法


參數(shù)用途: 
skip-name-resolve #禁止MySQL對外部連接進(jìn)行DNS解析skip-grant-tables

添加–skip-name-resolve方法:

[Mysqld] 
 ……skip-name-resolve……1234

修改配置文件添加并需要重啟。

參數(shù)優(yōu)化: 
skip-name-resolve 參數(shù)的目的是不再進(jìn)行反解析(ip不反解成域名),這樣可以加快數(shù)據(jù)庫的反應(yīng)時間。 
內(nèi)部有DNS服務(wù)器,對各服務(wù)器的IP做了反向解析,但未對內(nèi)網(wǎng)IP做反向解析,所以使用skip-name-resolve以后用內(nèi)網(wǎng)地址向mysqlslap請求響應(yīng)快了一半。

添加“–skip-name-resolve mode”參數(shù)后發(fā)現(xiàn)錯誤日志有

120203 10:21:06 [Warning] 'user' entry 'root@jimmyli' ignored in --skip-name-resolve mode.120203 10:21:06 [Warning] 'user' entry '@jimmyli' ignored in --skip-name-resolve mode.12

只需去服務(wù)器里邊把用戶root@jimmyli和@jimmyli刪除即可。 
提示W(wǎng)arning信息:

130739 11:12:22 [Warning] 'user' entry 'root@localhost.localdomain' ignored in --skip-name-resolve mode.130739 11:12:22 [Warning] 'user' entry '@localhost.localdomain' ignored in --skip-name-resolve mode.12

一般在優(yōu)化MySQL配置參數(shù)時,添加“–skip-name-resolve”,然后在重新啟動MYSQL時檢查啟動日志,發(fā)現(xiàn)有警告信息。如上。

原因分析: 
“–skip-name-resolve mode”是禁用dns解析,避免網(wǎng)絡(luò)DNS解析服務(wù)引發(fā)訪問MYSQL的錯誤,一般應(yīng)當(dāng)啟用。 
啟用“–skip-name-resolve mode”后,在MySQL的授權(quán)表中就不能使用主機(jī)名了,只能使用IP ,出現(xiàn)此警告是由于mysql 表中已經(jīng)存在有 localhost.localdomain 帳號信息。

解決方法: 
把Warning的賬號刪除就解決了。 
MySQL命令行:

mysql>use mysql;
mysql> delete from user where HOST='localhost.localdomain';
Query OK, 2 rows affected (0.00 sec)123

最后,重啟MySQL,再看錯誤信息提示,日志發(fā)現(xiàn)警告已經(jīng)沒有啦。該方法是mysql啟用skip-name-resolve模式時出現(xiàn)Warning的處理辦法。