[討論] MySQL資料庫無法遠端連接
想用java程式連接遠端的mysql資料庫,但是出現以下錯誤訊息:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago.
The driver has not received any packets from the server.
若是使用MySQL workbench進行連接,則會出現以下錯誤訊息:
http://i.imgur.com/mfQwfe9.png

即使把java程式拿到資料庫所在的伺服器上跑,也是出現一樣的錯誤訊息
但是把連接的ip改成127.0.0.1後,就可以正常連接了
my.ini中
skip-networking沒開啟
bind-address未設定,改成"0.0.0.0"也不行
伺服器防火牆關掉無效
帳號有允許任意ip連入(%)
請問這可能是什麼問題呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.193.209.142
※ 文章網址: http://www.ptt.cc/bbs/Database/M.1419399561.A.35A.html
補充:連接不上時,會等一段時間才跑出錯誤訊息
※ 編輯: Kenqr (123.193.209.142), 12/24/2014 13:54:56
→
12/26 01:16, , 1F
12/26 01:16, 1F
推
12/26 10:01, , 2F
12/26 10:01, 2F
→
12/26 10:02, , 3F
12/26 10:02, 3F
→
12/26 11:12, , 4F
12/26 11:12, 4F
→
12/26 19:24, , 5F
12/26 19:24, 5F
→
12/26 19:25, , 6F
12/26 19:25, 6F
→
12/26 23:49, , 7F
12/26 23:49, 7F
→
12/27 10:38, , 8F
12/27 10:38, 8F