Warum erhalte ich beim Herstellen einer Verbindung zu MySQL mit Java (Netbeans) die Fehlermeldung "Kommunikationsverbindungsfehler Das zuletzt gesendete Paket ..."?
Ich versuche, eine MySQL-Datenbank (die auf einer virtuellen Maschine (Debian) auf meinem PC installiert ist und eine IP-Adresse hat) zu verwenden192.168.1.5
) von Java unter Verwendung von NetBeans.
Ich habe die Verbindung wie folgt konfiguriert:
<code>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 </code>
und dann bekomme ich folgende Fehlermeldung:
<code>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.) </code>
Meinemysql.user
Tisch sieht so aus (ich weiß% root
ist nicht sehr sicher, aber dies ist nur zur Vereinfachung):
<code>+------------+------------------+ | host | user | +------------+------------------+ | % | root | | 127.0.0.1 | root | | ::1 | root | | debVirtual | | | localhost | | | localhost | debian-sys-maint | | localhost | phpmyadmin | | localhost | root | +------------+------------------+ </code>
Was kann ich tun, um diese Verbindung zuzulassen?