# 開啓慢查詢日誌
log-error=/mydata/mysql/data/slow.log
long_query_time=1
slow_query_log=ON
##開啓查詢緩存
explicit_defaults_for_timestamp=true
#禁用反向解析
dns skip-name-resolve
##開啓查詢緩存
explicit_defaults_for_timestamp=true
#禁用反向解析
dns skip-name-resolve
不禁用這個反向解析dns mysql默認會反向解析DNS,對於訪問者Mysql不會判斷是hosts還是ip都會進行dns反向解析,頻繁地查詢數據庫和權限檢查,這大大增加了數據庫的壓力,導致數據庫連接緩慢,嚴重的時候甚至死機,出現“連接數據庫時出錯”等字樣。