登陆 mysql -u root -p 添加远程ip访问权限 GRANT ALL PRIVILEGES ON *.* TO 'root'@'112.17.xxx.xxx' IDENTIFIED BY '123456' WITH GRANT OPTION; 刷新权限 flush privilege
输入mysql -u root -p 登陆数据库 运行命令: use mysql; select host, user from user; ##查看用户允许被访问的主机 继续输入命令: update user set host = '%' where user = 'root'; select