【MySql】配置外网可访问

登录linux系统进入数据库
mysql -u root -p
切换数据库到mysql配置数据库
use mysql
查询用户配置是否为允许网外访问,%表示运行任何ip访问
select host,user from user;

image.png

修改没有运行外网访问的用户host配置
update user set host="%" where user="用户名";
属性用户权限配置
flush privileges;

image.png

点击测试是否可连接
如果还是不行,可以检查下服务器的安全组是否放行,如果没有3306端口添加一下就行了。

image.png 同时检查一下iptables放行没有,没有添加一下

vim /etc/sysconfig/iptables

image.png

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×