Re: configuring mysql server
Alan Chandler <firstname.lastname@example.org> wrote:
The debian package says that be default the mysql server is installed with
networking disabled. /etc/my.cnf file has a paramerter for [mysqld] of
bind-address = 127.0.0.1
I am running mysqld on a machine with 3 interfaces
127.0.0.1 (ie the loopback)
192.168.0.20 (my lan interface)
18.104.22.168 (my wan interface)
I am trying to use it to support mythtv-backend so this means I need to change
it so mysql server listens on the loopback and on the lan interface. How?
The documentation for this parameter seems sparse. mysql documentation just
bind-address=IP the IP address to bind to.
No mention of what the default is if its not there.
Mythtv setup doesn't even mention it.
I am sure a requirement to bind to a
loopback address and one other is a
common requirement. How do you do it?
I am not sure if there is a better way but I recommend to you this one.
Set bind-address= 0.0.0.0
In this way mysql will listen on all your interfaces. Obviously you do not want some to enter through the wan so execute the next commands.
iptables -I INPUT -p tcp --dport 3306 -i eth0 -j DROP
iptables -I INPUT -p tcp --dport 3306 -i eth1 -j ACCEPT
iptables -I INPUT -p tcp --dport 3306 -i lo -j ACCEPT
and that's all. You will be able to access mysql from loopback and from lan, the connections from the wan will be droped.
Note: I suppose here that eth0 is the wan interface and eth1 is the lan, please fit to your needs.
I hope this help
Sergio Basurto J.
If I have seen further it is by standing on
shoulders of giants. (Isaac Newton)
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail.