Mysql – bind-address how does it work in thesql

configurationMySQL

I have a mysql running with bind-address "10.4.0.211".

From the documentation, I understand it like, the server accepts connections only from the IP – 10.4.0.211.

But I could able to connect to this mysql from another new server with the below configurations.

eth0      inet addr:10.8.0.7  
eth1      inet addr:10.11.0.50  
lo        inet addr:127.0.0.1  

None of the above has the bind address in them, but how come I am able to connect to the service. Please clarify.

I am suing the below connections string from the new server.

mysql -u<<username>> -p<<password>>  -h<<hostname of the mysql running server>> -A

Best Answer

From the documentation, I understand it like, the server accepts connections only from the IP - 10.4.0.211.

Your understanding is incorrect.

It has nothing to do with where the connection is coming from.

The server listens and accepts connections only on (not "from") the stated address. Where you can connect from is determined by the entries in the `mysql`.`user` table, which are created by GRANT statements, and, of course, whether you have network connectivity to the address where MySQL is listening.