方法一:修改MySQL自带的“mysql”数据库中的“USER”表
USE mysql; UPDATE USER SET HOST='%' WHERE USER='root'; SELECT * FROM USER;
方法二:采用授权的方式允许远程连接
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION ;