Can't remote connect to MySQL

February 21, 2015 2.7k views

I recently set up a new droplet to host some websites. Admittedly this is mostly all new too me as I've used exclusively shared hosting up until now. I installed Sentora (formerly Zpanel) to set up all my stuff through. Everything is working great, all the websites are just as they were when I had a shared hosting account.

One of my websites is for a Minecraft server. The Minecraft server is hosted elsewhere but needs to remotely connect to the database that the website uses to sync player data. However I'm getting "Could not connect to MySQL Server:Communications link failure" errors. I'm pretty sure everything is properly set up via Sentora, and also reflected on the Minecraft servers end. I've double and triple checked, and can't seem to get it to work.

I tried a few things based on research like changing the bind-address to in the my.cnf, but it didn't fix it.

Any feedback or ideas to resolve my issue would be much appreciated.

3 Answers

You need to add a user for your DO host in mysql, research for it on MySQL documentation. also be sure mysql is running over TCP and not just Socks, and that there is not firewall rules blocking MySQL port.

Not quite sure I understand what you mean by DO host in mysql. I do have 2 users set up that have access to the db. One that Xenforo (forum install) uses locally, and the remote user for the Minecraft server.

Protocol=TCP, and I don't see anything blocking the MySQL port.

This issue is resolved. Turns out I needed to set my bind-address to my server's IP.

Have another answer? Share your knowledge.