mysql默认禁止非本机访问

由于DBDesigner不好用,mysql的workbench还在beta,看了一眼也只是“初级阶段”,又换回了windows下的powerdesigner,好在我有两台电脑。

但是,默认却无法从windows主机连接到ubuntu下的mysql,错误:

Can’t connect to MySQL server on ‘192.168.10.18′ (10061)

原来,mysql的默认配置为了增强安全性,禁止了非本机的访问,在ubuntu中是这样,debian中也是。禁止的方式以前是在my.cnf中有一句

skip-network

现在则变成了:

# Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. bind-address = 127.0.0.1

就是只监听本机地址。所以,如果要开放局域网内的访问,需要注释掉这一句,或者改成:

bind-address = 0.0.0.0

另外,netstat -ant命令用来查看本机当前监听端口真的不错。

One thought on “mysql默认禁止非本机访问”

Leave a Reply to bill Cancel reply

Your email address will not be published. Required fields are marked *