最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

mysql远程连接Host*isnotallowedtoconnecttothisMySQL

来源:动视网 责编:小采 时间:2020-11-09 09:51:55
文档

mysql远程连接Host*isnotallowedtoconnecttothisMySQL

mysql远程连接Host*isnotallowedtoconnecttothisMySQL:如果mysql不支持远程连接,会出现提示:错误代码是1130,ERROR 1130: Host * is not allowed to connect to this MySQL server , 解决此问题有以下2个方法: localhost改成% 进入mysql的BIN目录 代码如下 mysql -u
推荐度:
导读mysql远程连接Host*isnotallowedtoconnecttothisMySQL:如果mysql不支持远程连接,会出现提示:错误代码是1130,ERROR 1130: Host * is not allowed to connect to this MySQL server , 解决此问题有以下2个方法: localhost改成% 进入mysql的BIN目录 代码如下 mysql -u


如果mysql不支持远程连接,会出现提示:错误代码是1130,ERROR 1130: Host * is not allowed to connect to this MySQL server ,

解决此问题有以下2个方法:

localhost改成%

进入mysql的BIN目录

代码如下

mysql -u root -p

mysql>use mysql;

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

mysql>flush privileges;

具体分析

1、在本机登入mysql后,更改“mysql”数据库里的“user”表里的“host”项,从”localhost”改为'%'。

代码如下
mysql>
mysql>use mysql;
mysql>select 'host' from user where user='root';

#查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)

代码如下
mysql>update user set host = '%' where user ='root';

#修改host值(以通配符%的内容增加主机/IP地址,当然也可以直接增加某个特定IP地址,如果执行update语句时出现ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 错误,需要select host from user where user = 'root';
查看一下host是否已经有了%这个值,如果有了直接执行下面的flush privileges;即可)

代码如下

mysql>flush privileges;
mysql>select host,user from user where user='root';
mysql>quit

另一种方法

如果你使用的是phpmyadmin我们可以登录phpmyadmin然后在权限管理中进入,这里会看到所有的用户了,你找到root用户点击修改,然后把域修改成%号即可了(注意,你必须是root权限用户登录哦,否则是不可以修改的)

文档

mysql远程连接Host*isnotallowedtoconnecttothisMySQL

mysql远程连接Host*isnotallowedtoconnecttothisMySQL:如果mysql不支持远程连接,会出现提示:错误代码是1130,ERROR 1130: Host * is not allowed to connect to this MySQL server , 解决此问题有以下2个方法: localhost改成% 进入mysql的BIN目录 代码如下 mysql -u
推荐度:
标签: 远程连接 mysql host
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top