阿里云服务器:CentOS 7.4;MySQL5.6
安装完mysql后直接远程是不行的,有3点需要注意。
1.阿里云服务器需要配置安全组,对3306端口开放
2.服务器firewalld也需要对3306端口开放
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
3.mysql允许远程连接
mysql -u root -p mysql;
grant all privileges on *.* to 'root'@'%' identified by '******';
flush privileges;
这样就可以远程阿里云服务器上数据库了。