1.需要在阿里云控制台安全设置里面开放3306端口。阿里云默认不开放3306端口
2.root的远程权限问题,默认是localhost本地
1>use mysql
2>select host,user from user
+-----------+---------------+ | host | user | +-----------+---------------+ | % | root | | localhost | mysql.session | | localhost | mysql.sys | +-----------+---------------+
要保证root的权限是%。意思是不限制ip。如果不是需要update user set host = ‘%’ where user = 'root' and host = 'localhost'更新权限
3>fulsh privileges更新权限