- 执行sql
grant all privileges on *.* to root@'%' identified by "password"
- 修改/etc/mysql/my.cnf
bind-address = 0.0.0.0
port = xxxx(这个端口根据自己情况指定,安全起见,建议修改)
- 重启mysql服务
service mysql stop
service mysql start
- 检查防火墙和云服务器安全组是否打开对应端口的访问权限
grant all privileges on *.* to root@'%' identified by "password"
bind-address = 0.0.0.0
port = xxxx(这个端口根据自己情况指定,安全起见,建议修改)
service mysql stop
service mysql start