my program refuses to connect to my mysql server when using my public ip, i've opened the port which it connects to and yet i still get some connection faliure.
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.
Here's the error message i get and below you can find the code for
Connection conn;
String dbuser ="usrname";
String dbpassw = "pass";
String databaseName = "dbname";
String url = "jdbc:mysql://"MY IP HERE":3306/"+databaseName;
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection(url,dbuser,dbpassw);
Statement st = conn.createStatement();
i used the ip you get from a whatsmyip site.