In the windows command box, i wrote :
and the result is :
It should be OK wright ? It looked like the user of "root" from 220.127.116.11 (which is my PC) can access the mysql database. Why the IP was rejected in Java ? Bellow is my java code to connect using JDBC :
String url = "jdbc:mysql://18.104.22.168:3306/dicom?jdbcCompliantTruncation=false";
con = DriverManager.getConnection(url, "root", "");
When it run, the error message occurs :
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
But if I change with "jdbc:mysql://localhost:3306/dicom" or "jdbc:mysql://127.0.0.1:3306/dicom", it runs well. It so confusing...