1 win+R 进入cmd命令窗口输入 mysql -u root -p
2 输入mysql登录密码
3 输入以下命令
USE mysql;SELECT \'host\' FROM USER WHERE USER=\'root\';UPDATE USER SET HOST = \'%\' WHERE USER =\'root\';FLUSH PRIVILEGES;
4
GRANT ALL PRIVILEGES ON *.* TO \'user\'@\'这里为远程IP地址\' IDENTIFIED BY \'mysql密码\' WITH GRANT OPTION;FLUSH PRIVILEGES;
5将上面文字出替换即可