mysql远程连接报错: Host * is not allowed to connect to this MySQL server,解决方法
2017-10-11 00:00
886 查看
解决此问题有以下2个方法:
localhost改成%
1.dos窗口 cd 到mysql的BIN目录
注:root为管理员用户名,root为用户root的密码:
mysql -u root -p root(可能有另外一种情况 mysql -u root -p MySql(数据库名) 回车后再输入密码)
mysql>use mysql;
mysql>update user set host ='%'where user ='root' and host ='localhost';
mysql>flush privileges;
注:这时候连接此服务器的mysql客户端需要重新启动下,然后再连接此服务器。
具体分析
1、在本机登入mysql后,更改“mysql”数据库里的“user”表里的“host”项,从”localhost”改为'%'。
mysql>
mysql>use mysql;
mysql>select 'host' from user where user='root';
#查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)
另一种方法
如果你使用的是客户端软件,我们可以在mysql服务器上使用客户端软件进入,在查询分析器中输入:(注意,你必须是root权限用户登录哦,否则是不可以修改的)
use mysql;
select * from user where user='root';
在查询结果中(只有一条)直接修改host列值,由localhost改为#,点击apply运行即可修改。然后重启客户端再重新连接即可。
或者:
use mysql;
update user set host = '%' where user ='root' and host='localhost'
然后重启客户端再重新连接即可。
localhost改成%
1.dos窗口 cd 到mysql的BIN目录
注:root为管理员用户名,root为用户root的密码:
mysql -u root -p root(可能有另外一种情况 mysql -u root -p MySql(数据库名) 回车后再输入密码)
mysql>use mysql;
mysql>update user set host ='%'where user ='root' and host ='localhost';
mysql>flush privileges;
注:这时候连接此服务器的mysql客户端需要重新启动下,然后再连接此服务器。
具体分析
1、在本机登入mysql后,更改“mysql”数据库里的“user”表里的“host”项,从”localhost”改为'%'。
mysql>
mysql>use mysql;
mysql>select 'host' from user where user='root';
#查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)
另一种方法
如果你使用的是客户端软件,我们可以在mysql服务器上使用客户端软件进入,在查询分析器中输入:(注意,你必须是root权限用户登录哦,否则是不可以修改的)
use mysql;
select * from user where user='root';
在查询结果中(只有一条)直接修改host列值,由localhost改为#,点击apply运行即可修改。然后重启客户端再重新连接即可。
或者:
use mysql;
update user set host = '%' where user ='root' and host='localhost'
然后重启客户端再重新连接即可。
相关文章推荐
- mysql远程连接 Host * is not allowed to connect to this MySQL server问题解决方法
- 解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL不允许从远程访问的方法
- 远程连接mysql 出现: 1130: Host is not allowed to connect to this MySQL server 解决
- 解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL不允许从远程访问的方法
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- 远程连接mysql时,提示“is not allowed to connect to this MySQL server”的解决方法
- IT忍者神龟之mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决
- 两台电脑,不同网段,互相连接数据库Host is not allowed to connect to this MySQL server解决方法
- mysql 远程访问不行解决方法,Host '' is not allowed to connect to this MySQL server
- mysql不支持远程连接的解决办法(#报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用lo
- 解决:MYSQL远程连接错误码:1130 Host 'xxx' is not allowed to connect to this MySQL server
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- 解决Navicat 报错:1130-host ... is not allowed to connect to this MySql server,MySQL不允许从远程访问的方法
- Host 'XXX' is not allowed to connect to this MySQL server 解决方法/开启MySQL远程账号
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法