< BACK

Access MySQL Server from Anywhere

A common question I get asked is how to access MySQL from another host that is not the localhost? The process involves two steps, the first one is to create a user with access from the host you’ll be accessing, I do not recommend that you select Any host. In fact, I do not recommend this article and you should to this with care.

The second step is to edit the my.cnf (in Ubuntu you’ll find it on /etc/mysql/) and comment, remove or set the IP address to the IP you’ll be accessing from.

After that, just restart the server and test

mysql -u username -h host-where-your-database-is-located -p


Share this: