mysql本地连接远程连接不上

首先测试linux下的端口有没有开通

/etc/init.d/iptables status

查看3306端口没有开通

使用以下命令开通

/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

/etc/init.d/iptables status      查看端口命令

再次访问还是连接不上我们查看mysql的远程访问有没有打开

本机登录mysql  

 运行以下命令打开远程连接

grant all privileges on *.* to root@'%' identified by 'password';

猜你喜欢

转载自www.cnblogs.com/oldzhang1222/p/10196038.html
今日推荐