MySQL Administration (Remote Access)

So, once you’re all set up and running, you may want to give users access from the outside world. This is clearly an entry point for hackers and script kiddies, so be sure that you want to open up your database to the net.

I believe that, out of the box, MySQL is bound to the localhost IP address ( so that will need changing first of all.

Edit my.cnf and find the line ‘bind-address’:


Now change this to allow access from other IP addresses, if you want *all* access then change it to or comment it out completely. You can only set it to one IP address, or all. (as shown)

Ensure your users can connect from the IP address you set it to:

GRANT <privileges> TO 'user'@'<ipaddress> IDENTIFIED BY '<password>';

for example


Or, to all this user access from anywhere:


Finally, restart the server and you’re done.

Let me just re-iterate, ensure you will be able to connect to the database from anywhere before restarting the server. Don’t blame me if you lock down a remote server with no access to it!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

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