edo1z blog

プログラミングなどに関するブログです

Eclipse4.2.2 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. 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. ----------------------------------------------------------

解決策

my.cnfの48,49行目付近にある、下記2行をコメントアウトしたら解決した。server-id = 1のコメントアウトは不要かもしれない。

skip-networking
server-id = 1

参考:http://okwave.jp/qa/q8065958.html