是由于在阿里云端有IP限制,因此容易致使没法远程的错误mysql
Ubuntu(CentOS 直接跳到第二步):c++
vim /etc/mysql/my.cnf
找到:sql
bind-address = 127.0.0.1
改成:数据库
bind-address = 0.0.0.0 #容许任意ip地址访问
也能够指定IP地址。
而后重启MySQL:vim
sudo /etc/init.d/mysqld restart
受权root用户进行远程链接,注意替换 “password” 为 root 用户真正的密码:ide
grant all privileges on *.* to root@"%" identified by "password" with grant option; flush privileges;
第二行命令使设置生效,能够立刻链接。阿里云