How to configure MySQL for remote access?

As I understand it, commenting our the bind-address is the same as setting it as

As regards iptables, you are 100% right. Though this takes a little explanation for any changes need to be saved else will be lost on reboot.

I am making a little tutorial on this and will add the link when I have it right. I imagine that cPanel do all this automatically. Thus any feature request that checks the bind-address / or sets the bind-address at the same time as allowing a remote connection should IMO add a specific rule to the iptable and block all others.

Sure – if you haven’t already, pop a feature request into the Bugs and Issues tracker (the link is below). Having Virtualmin be a little more “DWIM” may not be a bad idea, but we’ll see what Jamie thinks :slight_smile:

Yeah, I just wanted to chip in that I am having trouble with this my hoster, too.

I have been “spoiled” by cPanel, where I just select Remote MySQL, and put in my IP from DHCP server. When the DHCP lease expires, I just update the setting. Requiring that anyone who accessed a database remotely have a static IP sounds kind of draconian to me. A zillion cPanel providers feel that it’s not an unreasonable security risk to allow their users to enter arbitrary IP ranges for access, apparently, including %.%.%.%, but my host has not enabled the Remote Access tab- either he disagrees or just hasn’t been asked to enable it.

This could be a deal breaker for me, if I don’t get this function. I guess I just have to ask my host about the feature?

Yeah, ratchet up the DWIM, for sure :slight_smile: - just make it work.

There is another acronym…DWIAUT- Do What I Am Used To that applies, too, as you try to drag people over from other panels.


This issue has surfaced again, as I am trying to insert HTML pages in the database of a CMS system.


I’ll also check that I posted this as an FR…thought I did…

Can’t edit that last post- pops up “you’ve found a bug in the software”.

Anyway, it looks like at
that Jamie intended to address this a few months ago, but the status of that enhancement is not clear.


The “four step plan” from velvetpixel above wasn’t necessary for me - simply adding the remote IP I want to allow access using Virtualmin/Edit Databases/Remote Hosts did all that (Virtualmin 3.97.gpl).

For me, the missing step was that you have to go to Webmin/Servers/MySQL Database Server/MySQL Server Configuration/MySQL server listening address and change it to “any”.

Also, don’t forget to enable connections through the firewalls at both ends.

(This is not a very secure configuration for production use - at the very least, you should probably change the default port.)