MySQL开启用户远程登录权限

  • 第一步:选中mysql数据库
use mysql;
  • 第二步:修改库中user表中,user用户的host=%(任意连接)
update user set host='%' where user ='root';
  • 第三步:重新加载权限表
flush privileges;
  • 第四步:给root用户赋予远程连接权限
grant all privileges on *.* to 'root'@'%' with grant option;
  • 第五步:关闭防火墙 或开启防火墙(入站和出站)MySQL端口(默认:3306)

猜你喜欢

转载自blog.csdn.net/ayunnuo/article/details/112742465