Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Okay I currently have a database on my local machine (localhost) and it connects fine using the current code.
I can access my database fine, and load data from it.

I transferred this database onto a server online.

I change the code from:
Java
static final String URL = "jdbc:mysql://localhost:3306/";

to...
Java
static final String URL = "jdbc:mysql://fdb3.atspace.com:3306/";


I changed the username and the password too, and I seem to get this error:

Java
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.


I am unsure how to resolve it.
Can anyone help me?
Posted

1 solution

Can you connect to the server using http://www.mysql.com/products/workbench/[^]

My guess is that you're having problems with a firewall.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Willtwinny 30-Dec-11 12:20pm    
Sorry I am not very clear. I can connect to the server on my machine (localhost), however if I want to use my software on another machine then I would need to set up the server on that machine in order to use it.

Therefore to avoid doing having to do this, I have uploaded the mysql database to an online server and I want to connect that server (fdb3.atspace.com) however I seem to receive this error.

I have disabled my firewall and I still get the same error.
Espen Harlinn 31-Dec-11 5:13am    
And you can connect to the MySQL server on fdb3.atspace.com using the workbench?
Willtwinny 1-Jan-12 16:52pm    
No I can't seem to connect to the MySQL server using the workbench.
I have contacted the company (atspace.com), and got a unhelpful response so I am going to try and contact them again. I think it may be a problem with the atspace.com server?

What are your thoughts?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900