(1)授权访问%表示任意地址
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
(2)也可以修改user表中的host字段
update user set host = '%' where user = 'root';
另外注意3306端口是否可以访问,检查防火墙,云服务器修改安全规则。