MySQL資料庫罕見的BUG——Can't get hostname for your address

來源:互聯網
上載者:User

標籤:資料   需要   message   綠色   code   res   管理   .com   方案   

在串連mysql jdbc時候,拋出了

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communication link failure,  message from server: "Can‘t get hostname for your address"

的錯誤,無論是使用jdbc:mysql://127.0.0.1:3306還是jdbc:mysql://localhost:3306都出現了這個錯誤。

 

這個報錯的意思是“您的地址無法獲得主機名稱”,想到skip-name-resolve參數,但是加了這個參數後,由於我使用的是windows安裝的服務,故還是有這個錯誤,終於在一篇博文中找到瞭解決方案。http://blog.csdn.net/zzti_erlie/article/details/53227343

 

對於是綠色版的mysql,需要開啟my.ini,加上

[mysqld]skip-name-resolve#忽略主機名稱的方式訪問lower_case_table_names=1#忽略資料庫表名大小寫

然後重啟服務,該方案確實有效,但是對安裝服務的mysql就沒有效果了!

 

對於是安裝到windows服務的mysql,需要在服務管理中點擊選中MySQL服務,右鍵開啟屬性

 

MySQL資料庫罕見的BUG——Can't get hostname for your address

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.