MYSQL Error 1130:Host '计算机名' is not allowed to connect to this MySQL server
程序员文章站
2022-07-01 15:15:33
...
问题:
MFC应用程序远程访问MYSQL数据库,报错如标题:
查看MYSQL 5.1参考手册
猜测原因是无法给远程连接的用户权限问题。百度解决方法,整理如下。
解决方法:
1、以root账号登录mysql。
mysql -u root -p
2、选择数据库。
use mysql;
3、查看mysql库中的user表的host值(即可进行连接访问的主机/IP名称)。
select 'host' from user where user='root';
4、修改host值(以通配符%的内容增加主机/IP地址)。
update user set host = '%' where user ='root';
5、刷新MySQL的系统权限相关表。
flush privileges;
6、重启mysql服务。
推荐阅读
-
Mysql远程连接 Host * is not allowed to connect to this MySQL server
-
MySQL 1130 - Host 127.0.0.1 is not allowed to connect to this MySQL server
-
Navicat 连接 MySQL 失败 : 1130 - Host xxx is not allowed to connect to this MySQL server
-
MYSQL Error 1130:Host '计算机名' is not allowed to connect to this MySQL server
-
转:mysql远程连接 Host * is not allowed to connect to this MySQL server
-
MySQL安装提示错误Host '127.0.0.1' is not allowed to connect to this MySQL server
-
mysql数据库错误ERROR 1130:Host '' is not allowed
-
关于对连接数据库时出现1130-host “**” is not allowed to connect to this MySql/mariadb server 的错误解决方法
-
host...is not allowed to connect to this MySql server开放mys_MySQL
-
1130-host ... is not allowed to connect to t...解决_MySQL