Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 打开mysql 3306端口 #35

Open
hehongwei44 opened this issue Nov 6, 2015 · 1 comment
Open

CentOS 打开mysql 3306端口 #35

hehongwei44 opened this issue Nov 6, 2015 · 1 comment

Comments

@hehongwei44
Copy link
Owner

在CentOS系统中防火墙默认是阻止3306端口的,我们要是想访问mysql数据库,我们需要这个端口,命令如下:

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

我们需要保存我们的操作,命令如下:

1  /etc/rc.d/init.d/iptables save

此时我们可以查看端口的状态,命令如下:

1 /etc/init.d/iptables status

当然如果你打开其他端口也一样,只需要把这个端口号换乘你需要的端口号即可,比如8080,80等常用端口。

@hehongwei44
Copy link
Owner Author

在测试某项服务是否正常时,第一检查的就应该是端口。

这是血的教训呀。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant