views:

30

answers:

1

Hi all, I came across the bind address while trying to configure the mysql server. The details of why I want to configure the bind address is in the link below.

 http://stackoverflow.com/questions/3540051/multiple-hostnames-and-multiple-privileges

Now, I wan to understand the purpose of the bind address. In the sense, is a binding address the address we assign to the machine that is hosting the mysql server?

I have no clue. Would be really helpful if someone could explain me the purpose of it? and will assigning 0.0.0.0 to the binding address create any security flaws/loop holes?

+1  A: 

The address you specify in bind tells mysql where to listen. 0.0.0.0 is a special address, which means "bind to every available network".

Only client software which is able to open a connection to the server using the same address that is in specified in the 'bind' option will be allowed to connect.

Some examples:

  • If mysql binds to 127.0.0.1, then only software on the same computer will be able to connect (because 127.0.0.1 is always the local computer).
  • If mysql binds to 192.168.0.2 (and the server computer's IP address is 192.168.0.2 and it's on a /24 subnet), then any computers on the same subnet (anything that starts with 192.168.0) will be able to connect.
  • If mysql binds to 0.0.0.0, then any computer which is able to reach the server computer over the network will be able to connect.

These are all transport-level connections. Remote computers still need to qualify for application-level, which is to say they will still require the correct login credentials and host parameters from mysql.user.

Seth
Nice explation. But when I execute mysql -h 192.168.0.2 -u username -pI am able to connect to the mysql server if 192.168.0.2 is assigned appropriate permissions. So 192.168.0.2 here is the host of mysql server but not the client rite? If my understading about mysql -h ip is wrong, please do correct me.
Karthick