登陆阿里云主机mysql
use mysql;
update user set host = '%' where user = 'root' and host = 'localhost';
grant all privileges on *.* to root@'%' identified by 'mima';
flush privileges;
修改/etc/mysql/my.conf文件
注释掉 bind_address=127.0.0.1
最后service mysql restart;