Setting up MySQL to listen to external ports

I had some difficulty setting up mysql to listen to external ports on a server – the development web server uses databases on another box. The important setting was in /etc/mysql/my.cnf where I removed the line:


bind-address = 127.0.0.1

You should then be able to connect a client from another server to this mysql server.

As a warning – bear in mind that it is usually good practice to set up user permissions to only be valid when accessing from localhost if that is the intention – check your mysql table if you can log into the server but then start getting permission problems for other users.

Hope this helps someone!

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)