com.mysql.cj.jdbc.Exceptions.CommunicationsException: Kommunikationsverbindungsfehler
Ich habe den Connector bereits hinzugefügt (mysql-connector-j-8.0.33.jar) und mein Code ist dies:
Code: Select all
import java.sql.Connection;Code: Select all
import java.sql.DriverManager;Code: Select all
import java.sql.SQLException;Code: Select all
public class Conexion {Code: Select all
public static void main(String[] args) {Code: Select all
String url = "jdbc:mysql://localhost:3306/mi_base"; Code: Select all
String password = "";Code: Select all
try {Code: Select all
Connection conexion = DriverManager.getConnection(url, usuario, password);Code: Select all
System.out.println("Conexión exitosa");Code: Select all
} catch (SQLException e) {Code: Select all
e.printStackTrace();Code: Select all
}Code: Select all
}Code: Select all
}Was könnte diesen Kommunikationsfehler verursachen?
Ist es ein Verbindungs-, Port- oder Serverkonfigurationsproblem?
Mobile version