首页 > 数据库技术 > 详细

mysql error:Host is not allowed to connect to this MySql server

时间:2015-06-28 00:04:02      阅读:347      评论:0      收藏:0      [点我收藏+]

访问虚拟机中Mysql时出现如下错误:

技术分享

原因:该mysql用户不允许远程登录

解决:授权

1> 允许用户从任何主机连接到mysql server

GRANT ALL PRIVILEGES ON *.* TO username@% IDENTIFIED BY password WITH GRANT OPTION;
FLUSH PRIVILEGES;

2> 允许用户从指定IP访问mysql server

其中,host为特定IP地址

GRANT ALL PRIVILEGES ON *.* TO username@host IDENTIFIED BY password WITH GRANT OPTION;
FLUSH PRIVILEGES;

3> 允许用户从特定IP访问mysql server指定数据库

其中,host为特定IP地址

GRANT ALL PRIVILEGES ON dbname.* TO username@‘host IDENTIFIED BY password WITH GRANT OPTION;
FLUSH PRIVILEGES;

 

mysql error:Host is not allowed to connect to this MySql server

原文:http://www.cnblogs.com/chenyongjun/p/4604924.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!