Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In remote mysql 5.5 server I tried to add

bind-address =

Where bind-address = has commented out and 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.

share|improve this question
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
up vote 3 down vote accepted

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

TO 'someusername'@'' 
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.

share|improve this answer
Janne, the database server is a separate physical server whose IP is 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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.