mysql默认禁止非本机访问
授权方式:署名,非商业用途,保持一致,转载时请务必以超链接(http://www.fwolf.com/blog/post/192)的形式标明文章原始出处和作者信息及本声明。由于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
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
就是只监听本机地址。所以,如果要开放局域网内的访问,需要注释掉这一句,或者改成:
bind-address = 0.0.0.0
另外,netstat -ant命令用来查看本机当前监听端口真的不错。
No tags for this post.
![[Bloglines]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/bloglines.png)
![[del.icio.us]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/digg.png)
![[diigo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/diigo.png)
![[Facebook]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/myspace.png)
![[Reddit]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/slashdot.png)
![[Email]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/email.png)
March 7th, 2007 at 19:00:49
谢谢分享。
[Reply]