解决远程连接mysql出现1130错误

远程连接Mysql服务器的数据库,错误代码是 1130,ERROR 1130: Host xxx.xxx.xxx.xxx  is not allowed to connect to this MySQL server 

 null,  message from server: "Host 'DESKTOP-J2IEVTN' is not allowed to connect to this MySQL server"
查了半天资料是无法给远程连接的用户权限。
1.mysql -u root -p 
输入mysql密码
2.mysql;use mysql;  
3.mysql;select 'host' from user where user='root'; 

4.mysql;update user set host = '%' where user ='root';  
5.mysql;flush privileges;  
6.mysql;select 'host'   from user where user='root';
 

 
 

猜你喜欢

转载自blog.csdn.net/sinat_30777203/article/details/68942648