NetBeansを使用してJavaからMySQLデータベース(私のPCに仮想マシン(Debian)にインストールされ、IPアドレスが192.168.1.5
)を使用しようとしています。Java(Netbeans)を使用してMySQLに接続するときに、このエラー「通信リンクの障害が発生しました。
次のように私は、接続を設定している:
Driver Name MySQL(Connector/J Driver)
Host 192.168.1.5
Database test
Username root
Password *
JDBC URL jdbc:mysql://192.168.1.5:3306/test
をして、私は次のエラーを取得する:
cannot establish a connection to jdbc:mysql://192.168.1.5:3306/test using
com.mysql.jdbc.Driver (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.user
の表は、(私は% root
は非常に安全ではありません知っている、このように見えますが、これすぐに物事を簡素化することです):
+------------+------------------+
| host | user |
+------------+------------------+
| % | root |
| 127.0.0.1 | root |
| ::1 | root |
| debVirtual | |
| localhost | |
| localhost | debian-sys-maint |
| localhost | phpmyadmin |
| localhost | root |
+------------+------------------+
この接続を許可するにはどうすればよいですか?