linux mysql外网连接不成功的可能原因
1. 开启mysql访问权限mysql -hlocalhost -uroot -P3306 -p;use mysql;select * from user;grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option; flushflush privileges;2. 查...
·
1. 开启mysql访问权限
mysql -hlocalhost -uroot -P3306 -p;
use mysql;
select * from user;
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option; flush
flush privileges;
2. 查看端口是否占用
netstat -ntlp|grep 3306
3. 关闭防火墙或防火墙开启入站允许端口3306
服务器是centos7.4,防火墙为firewalld
1.查看开启防火墙没有,查看防火墙状态
ps -ef|grep firewall
firewall-cmd --state
2.查看防火墙规则
ps -ef|grep fire
3.添加3306规则
firewall-cmd --permanent --add-port=3306/tcp
3.重启防火墙
service firewalld reload
4.再看防火墙规则
3. 云服务器安全组开启端口允许访问
更多推荐
已为社区贡献5条内容
所有评论(0)