This question has been archived.

DO Cannot connect outside Mysql Server

April 15, 2016 1.5k views

I am having mysql server at my office and having a Droplet from DO with centos on it.

I am trying to connect to mysql server in my office from the terminal in my droplet, but it gave connection timed out while i can connect through my computer or other computer except from DO.

any ideas?

  • There are a couple potential issues that may be causing your problem:

    1.) By default MySQL is configured only to listen on localhost. An adjustment to your my.cnf can ensure that it is listening on a public IP.

    2.) Your office's network may be preventing the database server from being reachable. If your MySQL server has a non-public IP address (10.x.x.x or 192.168.x.x) then you will need to configure port-forwarding in your router or firewall so that requests to port 3306 (MySQL default port) to your office's public IP address are routed to your MySQL server.

  • I believe this is not the caused. Indeed my mysql server using a non public ip but i have do a port forward in the router. And as i mentioned above, i am able to connect to the mysql server anywhere (when i am leaving my company network), except from our DO droplet terminal. We are doing this because we are building an apps and we want to host our database by ourself.

Be the first one to answer this question.