mysql-server 4.15-1
以上都是以apt-get 最乾淨的netinstall iso系統安裝testing的包裝。
ip address為192.168.0.140
現在的/etc/mysql/my.cnf設定:
- 代碼: 選擇全部
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
#skip-external-locking
#bind-address = 127.0.0.1
然後...netstat -a
- 代碼: 選擇全部
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:mysql *:* LISTEN
mysql看來正常運作。telnet問題就出來了...
- 代碼: 選擇全部
debian:~# telnet localhost 3306
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
A
4.1.15-Debian_1-log:=cZxoDE,lokKr~DuD3qbConnection closed by foreign host.
debian:~# telnet 127.0.0.1 3306
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
A
4.1.15-Debian_1-logl<&HwC%.,WN^n0A70+(#vConnection closed by foreign host.
(ok,localhost跟127.0.0.1正常)
debian:~# telnet 192.168.0.140 3306
Trying 192.168.0.140...
Connected to 192.168.0.140.
Escape character is '^]'.
L#HY000Host '192.168.0.140' is not allowed to connect to this MySQL serverConnection closed by foreign host.
(出問題了...)
從這邊可見應該是mysql本身自己把對外port連線關掉了。而且我已經把許多前輩建議的
- 代碼: 選擇全部
skip-external-locking
bind-address = 127.0.0.1
註解起來。不知道還有那邊是需要修改的呢?