Linux论坛's Archiver

《开源》旗舰电子杂志2008年11期发布,火热下载中!

xyethink 发表于 2007-12-28 16:48

mysql连接问题

两个主机:Redhat 用rpm装了mysql,令一个是Windows XP,unzip的mysql

在windows下:c:\mysql -u root -h 192.168.64.214
提示:ERROR 1130 (00000): Host '192.168.64.215' is not allowed to connect to this MySQL server

在linux下:#mysql -u root -h 192.168.64.215
提示:ERROR 1130 (00000): Host '192.168.64.214' is not allowed to connect to this MySQL server

防火墙都关了,什么原因啊?

linuxpk 发表于 2007-12-28 17:33

linux下:#mysql -u root -p

9命怪猫 发表于 2007-12-28 17:33

查查mysql库的user表

权限问题。默认就是localhost访问。增加192.166.64.214 192.168.64.215的root访问权限。

Richeal 发表于 2007-12-28 17:40

那是用户权限的问题,
你试一下在装linux的主机下面用
mysql -u root -p
不要加 -h
如果你想任何一条电脑都能连上mysql的话,登录mysql以后运行以下sql语句

mysql4增加用户:
INSERT INTO mysql.user VALUES ('%',root',password('改成你要的密码'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);

mysql5增加用户
INSERT INTO mysql.user VALUES ('%','root',password('改成你想要的密码'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);

xyethink 发表于 2007-12-28 17:50

多谢楼上几位!

Flyinmorning 发表于 2007-12-28 21:06

grant all privileges on *.* to root@"%" identified by "password";
flush privileges;

choatrue 发表于 2008-3-20 11:09

顶Flyinmorning的回复。不能解决问题,我就从1楼跳下去。。。
呵呵。

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.