IP address could not be resolved: Temporary failure in name resolution,resolvedresolution
今早發現mysql日誌中有很多如下的警告:
140724 18:41:25 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:25 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:26 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:26 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:27 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:28 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:28 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:28 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:41:28 [Warning] IP address '172.16.18.217' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:54 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:55 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:55 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:55 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
140724 18:44:55 [Warning] IP address '61.143.209.110' could not be resolved: Temporary failure in name resolution
問題產生的原因:
出現錯誤的原因是MYSQL Server在本地記憶體中維護了一個非本地的Client TCP cache,這個cache中包含了遠程Client的登入資訊,比如IP地址,hostname等資訊。
如果Client串連到伺服器後,Mysql首先會在本地TCP池中根據IP位址解析用戶端的hostname或者反解析,如果解析不到,就會去DNS中進行解析,如果還是解析失敗
就是在error log中寫入這樣的警告資訊。
解決的辦法:
1.可以通過兩個參數來disable這個功能,在MYSQL的設定檔中[mysqld]中加入下面的參數:
[mysqld]
--skip-host-cache
--skip-name-resolve
重新授權,將所有訪問資料庫伺服器的授權方式都改成IP形式的。
grant all on *.* to ‘root’@’172.16.12.68’identified by ‘123456’;
2.添加授權。
將所有訪問資料庫伺服器的授權方式都改成IP形式。
不同的使用者用不同的使用者名稱和密碼。
grant all on *.* to ‘user_68’@’172.16.12.68’identified by ‘pwd_68’;
grant all on *.* to ‘user_67’@’172.16.12.67’identified by ‘pwd_67’;
....
然後去 mysql資料庫下面的 user表 和db表 下面刪除掉那些含有含有主機名稱字的許可權記錄。
總結:
1.要麼加上
--skip-host-cache
--skip-name-resolve
使得MySQL將不再通過DNS解析地址。
2.要麼在賦予許可權的時候 直接用ip地址,去掉那些用主機名稱字的許可權。
localhost: ssh: localhost: Temporary failure in name resolution 怎解決,跪!!!!
提示是你沒有名字解析,你需要配置dns伺服器位址(dns伺服器上必須要有對應的條目),或者你可以使用IP地址來直接進行串連。
電腦總是彈出The server name or address could not be resolved的視窗,無線網也串連不上,解答
試試運行cmd,再執行這個命令ipconfig /renew, 修複一下網路連接,看行不行。