mysql –uroot –p
use mysql;
UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1;
flush privileges;
记得配置3306端口外网可访问。