美文网首页
远程连接MySQL数据库报错:is not allowed to

远程连接MySQL数据库报错:is not allowed to

作者: 小五愣 | 来源:发表于2021-02-26 11:39 被阅读0次

可能是你的帐号不允许从远程登陆,只能在localhost;
只要在localhost的那台电脑,登入MySQL后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,"localhost"改"%"

mysql -u $用户名 -p

mysql>use mysql;

mysql>update user set host = '%' where user = 'root';

mysql>select host, user from user;

mysql>FLUSH   PRIVILEGES  //修改生效

mysql>EXIT  //退出MySQL服务器

相关文章

网友评论

      本文标题:远程连接MySQL数据库报错:is not allowed to

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