I installed MySql on Windows 7 and I put the Connector/J in the /lib/ext folder. I'm trying to connect to a database from Java, but I keep getting this error message:
"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."
This is my code:
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/test",
"test_user", "password");
con.close();
How do I fix this?
"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."
This is my code:
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/test",
"test_user", "password");
con.close();
How do I fix this?