Com*_*ade 12 lamp firewall networking application-development mariadb
我无法远程访问我的数据库,我唯一发现的是端口 3306 对 127.0.0.1 开放,我希望它在全球范围内开放。我在访问数据库时收到的错误是无法建立连接,因为目标机器主动拒绝了它。
我有ubuntu 16.04
,安装mariaDB
,bind-address = 0.0.0.0
。
当我点击sudo netstat -plnt
它时返回:
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 21013/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1172/sshd
tcp6 0 0 :::8080 :::* LISTEN 13710/apache2
tcp6 0 0 :::80 :::* LISTEN 13710/apache2
tcp6 0 0 :::22 :::* LISTEN 1172/sshd
tcp6 0 0 :::443 :::* LISTEN 13710/apache2
Run Code Online (Sandbox Code Playgroud)
没有0 0.0.0.0:3306
。
我怎么能允许0 0.0.0.0:3306
。
sudo ufw status
返回:
Apache Full ALLOW Anywhere
22 ALLOW Anywhere
3306 ALLOW 161.202.20.0/24
3306 on eth1 ALLOW Anywhere
3306 ALLOW Anywhere
Apache Full (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
3306 (v6) on eth1 ALLOW Anywhere (v6)
3306 (v6) ALLOW Anywhere (v6)
Run Code Online (Sandbox Code Playgroud)
在远程访问数据库时,我收到No connection could be made because the target machine actively refused it.
.
Edu*_*scu 19
允许端口
sudo ufw allow 3306
Run Code Online (Sandbox Code Playgroud)
如果未安装它的 ufw 可能是 iptables
sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
77484 次 |
最近记录: |