Cannot connect to mysql/mariadb from java

  • Posted July 23, 2014

Hi - I am having significant difficulties in connecting my (locally run in eclipse) java application to mysql hosted on the Digital Ocean platform.

Strangely enough however, using mysql workbench I can connect with no issues at all from my desktop.

For slightly more comprehensive report with images i have posted on stack overflow here - - unfortunately some power hungry idiot decided to mark my question solved / duplicated when the solution he provided also does not work.

Please can someone with experience of writing java applications that run on the Digital Ocean platform please let me know how to approach solving this issue.

Kind regards



Hi Ricki!

Thanks for posting your question. Since a lot of our site is responsive and users can reply from all sorts of devices, we recommend keeping as much information on the DO site as possible, to facilitate answers.

Just as an FYI, adding pictures to DO questions can be done in markdown with

![alt text](Image URL)

See exhibit A below.

very cute cat

I look forward to seeing your question answered :)

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I think that the comment on your StackOverflow question is closing in on the problem. When you connect to the database through MySql Workbench, it is being tunneled via SSH (on port 22) and then connects to MySql on localhost port 3306. Sure enough, running nmap on your IP address shows that port 3306 is not open.

Are you running some kind of firewall? You need to open port 3306.