美文网首页
2019-12-14解决host is not allow to

2019-12-14解决host is not allow to

作者: keaiduoduo | 来源:发表于2019-12-14 21:42 被阅读0次

安装的mysql服务默认是只允许本机访问的,如下图:

select Host, User from user

当你想要远程访问本机的数据库时,就会出现如下的错误:


连接错误

解决办法:

第一步:

use mysql;

第二步:

select Host, User from user;

第三步:

UPDATE user set Host = '%' where User = 'root';

第四步:

FLUSH PRIVILEGES;

搞定:

连接成功

相关文章

网友评论

      本文标题:2019-12-14解决host is not allow to

      本文链接:https://www.haomeiwen.com/subject/dathnctx.html