Report this

What is the reason for this report?

Cannot connect to mysql/mariadb from java

Posted on 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 - http://stackoverflow.com/questions/24918353/cant-connect-to-mariadb-from-java-only-with-mysqldeveloper - 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

Ricki



This textbox defaults to using Markdown to format your 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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.