Menu Close

Cannot connect to MySQL on a remote host


  • Cannot connect to a MySQL database on a remote host (port 3306)
  • Firewalls aren’t blocking traffic and network connectivity is available.
  • The MySQL database is up and running on the remote host and can be accessed when connecting from to it on the remote host (as localhost)


Access to a MySQL database may be restricted and this restriction may be configured in the configuration file A directive such as bind-address= will ensure that the MySQL database can be accessed only from localhost.


  1. Edit the configuration file and ensure that the following is set:
    bind-address=<external-ip of remote host>
  2. Restart MySQL

Root Cause:

Connectivity to the MySQL database was restricted in the configuration file with the bind-address directive.


(1) The solution above describes a successful problem-solving experience and may not be applicable to other problems with similar symptoms.
(2) Your rating of this post will be much appreciated. Also, feel free to leave comments.


VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *