叶金荣(yejr)早年曾混迹于linuxforum、linuxsir、chinaunix等社区。
2006年建本站至今,是国内最早的一批MySQL技术博客之一。
从事过LAMP开发,后成为专职MySQL DBA,擅长MySQL优化、数据库架构设计及对比基准压测。
2012年被提名成为ORACLE MySQL ACE。
2015年创办靠谱、优质的在线培训品牌知数堂专注培养优秀互联网从业人才以及企业服务。
2018年发起「3306π」社区
微信公众号:老叶茶馆(imysql_wx)
微博:@叶金荣
QQ群: 579036588
邮箱:yejr@qq.com
神器: 自动生成my.cnf
搜索引擎中的我:谷歌Google、360搜索、百度、搜狗。
买茶找我: 自家茶叶店
【老叶茶馆】微信公众号二维码
七星 (未验证)
周二, 2008/06/17 - 09:47
Permalink
这篇文章有误,mysql是可以绑定多个IP的, 只需添加多行bind-address即可.
yejr
周二, 2008/06/17 - 09:55
我测试过了,是可以指定多行,但是只有最后一个生效(mysql 5.0.45),你确信你测试过?
MySQL方案、培训、支持
周三, 2008/06/18 - 12:26
可以的,我一直在使用这种方法呀. 我的版本是5.0.41-log. 我看了另一台服务器是mysql 5.0.41的,也是可以.
周三, 2008/06/18 - 13:07
麻烦贴下你的配置,还有 netstat -na 的结果
周三, 2008/06/18 - 17:14
公网地址处理了一下.
Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:672 0.0.0.0:* LISTEN tcp 0 0 192.168.5.4:3306 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 192.168.5.4:3306 192.168.5.20:47630 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:46607 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:45828 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:45063 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:46386 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:48165 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:48166 ESTABLISHED tcp 0 0 192.168.5.4:44153 192.168.5.3:3306 ESTABLISHED tcp 0 0 192.168.5.4:3306 192.168.5.20:47680 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:45695 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:46953 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:47205 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:48031 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:45453 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:47794 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:45991 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:47313 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:48068 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:45055 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:46840 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:46072 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:45301 TIME_WAIT tcp 0 0 192.168.5.4:3306 192.168.5.20:45811 TIME_WAIT tcp 0 0 :::45622 :::* LISTEN tcp 0 0 ::1:631 :::* LISTEN tcp 0 0 ::ffff:218.240.1.1:45622 ::ffff:211.147.10.22:13398 ESTABLISHED udp 0 0 0.0.0.0:32768 0.0.0.0:* udp 0 0 0.0.0.0:666 0.0.0.0:* udp 0 0 0.0.0.0:669 0.0.0.0:* udp 0 0 0.0.0.0:161 0.0.0.0:* udp 0 0 0.0.0.0:5353 0.0.0.0:* udp 0 0 0.0.0.0:111 0.0.0.0:* udp 0 0 0.0.0.0:631 0.0.0.0:* udp 0 0 :::32769 :::* udp 0 0 :::5353 :::* Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 2 [ ACC ] STREAM LISTENING 13752 /tmp/mysql.sock unix 2 [ ACC ] STREAM LISTENING 42919964 /tmp/ssh-CGuWng9661/agent.9661 unix 2 [ ACC ] STREAM LISTENING 39570120 /var/run/cups/cups.sock unix 2 [ ACC ] STREAM LISTENING 8105 /var/run/avahi-daemon/socket unix 2 [ ACC ] STREAM LISTENING 7955 /dev/gpmctl unix 15 [ ] DGRAM 6947 /dev/log unix 2 [ ACC ] STREAM LISTENING 7236 /var/run/dbus/system_bus_socket unix 2 [ ACC ] STREAM LISTENING 7297 /var/run/sdp unix 2 [ ACC ] STREAM LISTENING 7372 /var/run/pcscd.comm unix 2 [ ACC ] STREAM LISTENING 7512 /var/run/acpid.socket unix 2 [ ] DGRAM 1954 @/org/kernel/udev/udevd unix 2 [ ACC ] STREAM LISTENING 8015 /tmp/.font-unix/fs7100 unix 2 [ ] DGRAM 8145 @/org/freedesktop/hal/udev_event unix 2 [ ACC ] STREAM LISTENING 8136 @/var/run/hald/dbus-52pP5mfID2 unix 2 [ ACC ] STREAM LISTENING 8137 @/var/run/hald/dbus-nhMyE3sdLE unix 3 [ ] STREAM CONNECTED 9630 /var/run/dbus/system_bus_socket unix 3 [ ] STREAM CONNECTED 9629 unix 3 [ ] STREAM CONNECTED 9346 /var/run/acpid.socket unix 3 [ ] STREAM CONNECTED 9345 unix 3 [ ] STREAM CONNECTED 9338 @/var/run/hald/dbus-52pP5mfID2 unix 3 [ ] STREAM CONNECTED 9335 unix 3 [ ] STREAM CONNECTED 8140 @/var/run/hald/dbus-nhMyE3sdLE unix 3 [ ] STREAM CONNECTED 8139 unix 3 [ ] STREAM CONNECTED 8107 /var/run/dbus/system_bus_socket unix 3 [ ] STREAM CONNECTED 8106 unix 3 [ ] STREAM CONNECTED 8102 unix 3 [ ] STREAM CONNECTED 8101 unix 2 [ ] DGRAM 8100 unix 2 [ ] DGRAM 7952 unix 2 [ ] DGRAM 7931 unix 2 [ ] DGRAM 7912 unix 2 [ ] DGRAM 7840 unix 2 [ ] DGRAM 7534 unix 2 [ ] DGRAM 7479 unix 2 [ ] DGRAM 7392 unix 2 [ ] DGRAM 7365 unix 3 [ ] STREAM CONNECTED 7283 /var/run/dbus/system_bus_socket unix 3 [ ] STREAM CONNECTED 7282 unix 2 [ ] DGRAM 7266 unix 2 [ ] DGRAM 7257 unix 3 [ ] STREAM CONNECTED 7238 unix 3 [ ] STREAM CONNECTED 7237 unix 3 [ ] STREAM CONNECTED 7201 unix 3 [ ] STREAM CONNECTED 7200 unix 2 [ ] DGRAM 7053 unix 2 [ ] DGRAM 6957
周三, 2008/06/18 - 17:30
你如何配置的?公网地址用abc代替就行了。
周三, 2008/06/18 - 19:00
只贴出mysqld部分. 我没有监听公网地址. [mysqld] port = 3306 socket = /tmp/mysql.sock basedir=/home/server/mysql datadir=/data/mysqldata skip-locking skip-name-resolve #skip-slave-start key_buffer = 2048M max_allowed_packet = 16M query_cache_size=16777216 table_cache = 512 sort_buffer_size = 4096K net_buffer_length = 8K read_buffer_size = 4096K read_rnd_buffer_size = 16M myisam_sort_buffer_size = 64M thread_concurrency = 8 default-character-set=utf8 default-collation=utf8_general_ci
thread_cache_size=16
max-connections=1500
bind-address=127.0.0.1 bind-address=192.168.5.4
周三, 2008/06/18 - 20:52
嗯,但是没看到你的 netstat 结果中有监听了 127.0.0.1:3306 啊?
周三, 2008/06/18 - 12:29
顺便说一下我的服务器是centos4.X系列的.
评论
七星 (未验证)
周二, 2008/06/17 - 09:47
Permalink
这篇文章有误,mysql是
这篇文章有误,mysql是可以绑定多个IP的, 只需添加多行bind-address即可.
yejr
周二, 2008/06/17 - 09:55
Permalink
我测试过了,是可以
我测试过了,是可以指定多行,但是只有最后一个生效(mysql 5.0.45),你确信你测试过?
MySQL方案、培训、支持
七星 (未验证)
周三, 2008/06/18 - 12:26
Permalink
可以的,我一直在使用
可以的,我一直在使用这种方法呀. 我的版本是5.0.41-log. 我看了另一台服务器是mysql 5.0.41的,也是可以.
yejr
周三, 2008/06/18 - 13:07
Permalink
麻烦贴下你的配置,
麻烦贴下你的配置,还有 netstat -na 的结果
MySQL方案、培训、支持
七星 (未验证)
周三, 2008/06/18 - 17:14
Permalink
公网地址处理了一下.
公网地址处理了一下.
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:672 0.0.0.0:* LISTEN
tcp 0 0 192.168.5.4:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 192.168.5.4:3306 192.168.5.20:47630 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:46607 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:45828 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:45063 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:46386 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:48165 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:48166 ESTABLISHED
tcp 0 0 192.168.5.4:44153 192.168.5.3:3306 ESTABLISHED
tcp 0 0 192.168.5.4:3306 192.168.5.20:47680 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:45695 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:46953 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:47205 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:48031 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:45453 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:47794 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:45991 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:47313 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:48068 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:45055 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:46840 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:46072 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:45301 TIME_WAIT
tcp 0 0 192.168.5.4:3306 192.168.5.20:45811 TIME_WAIT
tcp 0 0 :::45622 :::* LISTEN
tcp 0 0 ::1:631 :::* LISTEN
tcp 0 0 ::ffff:218.240.1.1:45622 ::ffff:211.147.10.22:13398 ESTABLISHED
udp 0 0 0.0.0.0:32768 0.0.0.0:*
udp 0 0 0.0.0.0:666 0.0.0.0:*
udp 0 0 0.0.0.0:669 0.0.0.0:*
udp 0 0 0.0.0.0:161 0.0.0.0:*
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp 0 0 0.0.0.0:111 0.0.0.0:*
udp 0 0 0.0.0.0:631 0.0.0.0:*
udp 0 0 :::32769 :::*
udp 0 0 :::5353 :::*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 13752 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 42919964 /tmp/ssh-CGuWng9661/agent.9661
unix 2 [ ACC ] STREAM LISTENING 39570120 /var/run/cups/cups.sock
unix 2 [ ACC ] STREAM LISTENING 8105 /var/run/avahi-daemon/socket
unix 2 [ ACC ] STREAM LISTENING 7955 /dev/gpmctl
unix 15 [ ] DGRAM 6947 /dev/log
unix 2 [ ACC ] STREAM LISTENING 7236 /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 7297 /var/run/sdp
unix 2 [ ACC ] STREAM LISTENING 7372 /var/run/pcscd.comm
unix 2 [ ACC ] STREAM LISTENING 7512 /var/run/acpid.socket
unix 2 [ ] DGRAM 1954 @/org/kernel/udev/udevd
unix 2 [ ACC ] STREAM LISTENING 8015 /tmp/.font-unix/fs7100
unix 2 [ ] DGRAM 8145 @/org/freedesktop/hal/udev_event
unix 2 [ ACC ] STREAM LISTENING 8136 @/var/run/hald/dbus-52pP5mfID2
unix 2 [ ACC ] STREAM LISTENING 8137 @/var/run/hald/dbus-nhMyE3sdLE
unix 3 [ ] STREAM CONNECTED 9630 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 9629
unix 3 [ ] STREAM CONNECTED 9346 /var/run/acpid.socket
unix 3 [ ] STREAM CONNECTED 9345
unix 3 [ ] STREAM CONNECTED 9338 @/var/run/hald/dbus-52pP5mfID2
unix 3 [ ] STREAM CONNECTED 9335
unix 3 [ ] STREAM CONNECTED 8140 @/var/run/hald/dbus-nhMyE3sdLE
unix 3 [ ] STREAM CONNECTED 8139
unix 3 [ ] STREAM CONNECTED 8107 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 8106
unix 3 [ ] STREAM CONNECTED 8102
unix 3 [ ] STREAM CONNECTED 8101
unix 2 [ ] DGRAM 8100
unix 2 [ ] DGRAM 7952
unix 2 [ ] DGRAM 7931
unix 2 [ ] DGRAM 7912
unix 2 [ ] DGRAM 7840
unix 2 [ ] DGRAM 7534
unix 2 [ ] DGRAM 7479
unix 2 [ ] DGRAM 7392
unix 2 [ ] DGRAM 7365
unix 3 [ ] STREAM CONNECTED 7283 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7282
unix 2 [ ] DGRAM 7266
unix 2 [ ] DGRAM 7257
unix 3 [ ] STREAM CONNECTED 7238
unix 3 [ ] STREAM CONNECTED 7237
unix 3 [ ] STREAM CONNECTED 7201
unix 3 [ ] STREAM CONNECTED 7200
unix 2 [ ] DGRAM 7053
unix 2 [ ] DGRAM 6957
yejr
周三, 2008/06/18 - 17:30
Permalink
你如何配置的?公网
你如何配置的?公网地址用abc代替就行了。
MySQL方案、培训、支持
七星 (未验证)
周三, 2008/06/18 - 19:00
Permalink
只贴出mysqld部分.
只贴出mysqld部分. 我没有监听公网地址.
[mysqld]
port = 3306
socket = /tmp/mysql.sock
basedir=/home/server/mysql
datadir=/data/mysqldata
skip-locking
skip-name-resolve
#skip-slave-start
key_buffer = 2048M
max_allowed_packet = 16M
query_cache_size=16777216
table_cache = 512
sort_buffer_size = 4096K
net_buffer_length = 8K
read_buffer_size = 4096K
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 64M
thread_concurrency = 8
default-character-set=utf8
default-collation=utf8_general_ci
thread_cache_size=16
max-connections=1500
bind-address=127.0.0.1
bind-address=192.168.5.4
yejr
周三, 2008/06/18 - 20:52
Permalink
嗯,但是没看到你的
嗯,但是没看到你的 netstat 结果中有监听了 127.0.0.1:3306 啊?
MySQL方案、培训、支持
七星 (未验证)
周三, 2008/06/18 - 12:29
Permalink
顺便说一下我的服务
顺便说一下我的服务器是centos4.X系列的.