I am trying to connect to MYSQL
server hosted on MAMP Pro
. I am trying to connect from the same client machine using java and VBA
. VBA
connects fine but java gives me the error after few seconds
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.
On Java
String userName = "user";
String password = "pass";
String url = "jdbc:mysql://10.0.1.1/datab";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection (url, userName, password);
On VBA
Sub ConnectToDatabase()
Set oConn = New ADODB.Connection
oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=10.0.1.1;" & _
"DATABASE=datab;" & _
"USER=user;" & _
"PASSWORD=pass;" & _
"PORT=3306;" & _
"Option=3"
End Sub
telnet 10.0.1.1 3306
accepts connection from the client machine.
My Bind address is the server IP on my.conf
I'm using mysql-connector-java 5.1.18