0

In remote mysql 5.5 server I tried to add

bind-address = 11.22.33.44

Where bind-address = 127.0.0.1 has commented out and 11.22.33.44 is the Ip of the web server communicating with the database server. But after adding the line mysql does not restart. Any ideas to fix this? Also, I'd like to know other ways to harden the connection.

alfish
  • 3,127
  • 15
  • 47
  • 71
  • Are you trying to limit which remote hosts can connect to your MySQL server? `bind-address` is not the right way to do that. – Ladadadada Jun 29 '12 at 11:54

1 Answers1

3

Is the web server the same physical server than the database server? bind-address should be an address that is assigned to your server -- if ifconfig lists the address, then you can use it for MySQL. You can't just blindly pick some IP and put that as bind-address, no sir.

EDIT: It seems you understand bind-address completely wrong.

1) Put your database server IP address as bind-address.

2) With MySQL GRANT statements, allow your web server IP (or DNS name...) to access certain database as certain user with the privileges you want to grant, for example

GRANT SELECT,INSERT,UPDATE,DELETE ON mywpinstallation.* 
TO 'someusername'@'yourwebservername.yourdomain.com' 
IDENTIFIED BY 'supersecretpassword'

3) Configure your web application to contact your database server as the user you just granted.

4) Make sure your database server is not reachable from the outside world; use the firewall you have, or if you somehow don't have a separate firewall, just use iptables.

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
  • Janne, the database server is a separate physical server whose IP is 11.22.33.44. So how can I bind it mysql server to webserver's IP? – alfish Jun 29 '12 at 11:56
  • Domains in MySQL auth can be tricky. Better to stick to IP addresses. The wildcard `%` is allowed. – Ladadadada Jun 29 '12 at 12:08
  • @Ladadadada: Sure, the `%` is allowed but bit too wide open for my taste. With the simple setups domains work OK, but of course if the web server has multiple domains set, things change... – Janne Pikkarainen Jun 29 '12 at 12:10