详细信息 您现在的位置是:首页 > 数据库

阿里云服务器数据库远程链接不上

来源: 发布时间:2021-07-10 1162 人已围观

摘要阿里云服务器数据库远程链接不上,报1130 host is not allowed to connect to this mysql server这样错误;

远程链接阿里云服务器数据库报:1130, "Host 'xxxx' is not allowed to connect to this MySQL server"。

查了下应该是数据库的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%";l


或者通过服务器通过xshell等,登录数据库设置:


mysql -u root -p


mysql>use mysql;

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

mysql>select host, user from user;

查看修改后内容:

aaa.jpg


mysql>flush privileges;

bbb.jpg

再去远程链接,就可以 顺利的链接上了;


站点信息

  • 电话:15226178738
  • QQ:1697915848
  • 邮箱:1697915848@qq.com