天天看點

Can‘t get hostname for your address解決辦法

前言

意思是根據你的位址找不到主機名,試了在my.ini檔案加各種東西還是不管用,看到能改服務就試了一下,果然就成功了,這個方法隻限于本地通路MySQL資料庫失敗,要是你真是用網絡服務,還是在my.ini檔案中加各種東西吧

打開服務頁面,觀察MySQL的服務是否為網絡服務

右鍵單擊計算機,選擇管理,最下面有服務和應用程式選項,點選服務就是如下界面

Can‘t get hostname for your address解決辦法

我這裡MySQL57已經改為本地系統了,原來是網絡服務

如果是網絡服務,點選選中MySQL服務,右鍵打開屬性

Can‘t get hostname for your address解決辦法

設定為如下即可,一連果然成功了,結果又遇到這個警告(忽略即可,也可以通過加參數得到解決)

Sat Nov 19 08:59:14 CST 2016 WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false’. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

推薦