MySQL bind-address

来源:互联网 发布:天刀蓝忘机捏脸数据 编辑:程序博客网 时间:2024/05/17 06:04

--bind-address=IP

Command-Line Format--bind-address=nameConfig-File Formatbind-address Permitted Values TypestringDefault0.0.0.0Range0.0.0.0-255.255.255.255

The IP address to bind to. Only one address can be selected. If this option is specified multiple times, the last address given is used.

If no address or 0.0.0.0 is specified, the server listens on all interfaces.

 

mysql启动的时候,也就是本地localhost的时候,他自己会找127.0.0.1

可以看一下netstat -ant,端口listen的时候,是0.0.0.0也就是说ALL,

 

You can bind only to network interfaces available on the machine where MySQL is running.

Assume your PC has 3 network interfaces:
- 127.0.0.1 (local host or local loop)
- 192.168.0.50 (network card/cable)
- 192.168.0.70 (network card/wireless)

Normally, the MySQL server will listen on all three interfaces. This is the default, but if it makes you happy :-) you could set it explicitly, with --bind-address='0.0.0.0'.

If you want MySQL to listen only on the cable interface you would set --bind-address='192.168.0.50'.

原创粉丝点击