hello there I am new to MySQL Server and I want to connect to MySQL DataBase remotely from my computer other than database placed on! My IP on machine on which I have MySQL server is:
39.32.58.13
and I am using this code to connect:
private Connection connect = null;
private Statement statement = null;
private PreparedStatement preparedStatement = null;
private ResultSet resultSet = null;
private void Connect(){
try{
// this will load the MySQL driver, each DB has its own driver
Class.forName("com.mysql.jdbc.Driver");
// setup the connection with the DB.
connect = DriverManager
.getConnection("jdbc:mysql://39.32.222.77:3306/test","myname", "mypass");
}
}
But it gives me an error all the time:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 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.
Is it me doing something wrong because I'm doing it for the first time and need instructions on how to do it ! so please dont mind my mistakes thanks in advance