Can’t connect to mysql server on remote server

By default mysql does not allow connects to itself from any host besides localhost, for security reasons.

When you get an error “Can’t connect to mysql server on [remote server]” when trying to connect to the remote SQL server via the mysql command line tool, log into the server running the mysql server and edit the /etc/mysql/my.cnf config file.

In particular, comment out the following line:
bind-address           = 127.0.0.1
This allows for connections from any host.

Next, update the mysql user to allow it access from a host other than ‘localhost’.


Posted

in

,

by

Comments

2 responses to “Can’t connect to mysql server on remote server”

  1. […] Subscribe to feed ‹ Can’t connect to mysql server on remote server […]

  2. Channa Avatar
    Channa

    It works, many thanks

Leave a Reply

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