ufw enable port 3306 for mysql access, but can not ping

enter image description here

enter image description here

above are my ufw status

but if I ping 3306 at

https://ping.eu/port-chk/

it reports the port is closed

your comment welcome


Your default mysqld config is binding to 127.0.0.1 (localhost). You need to modify bind-address to 0.0.0.0 for listening all interfaces in file mysqld.cnf (/etc/mysql/mysql.conf.d/mysqld.cnf)

bind-address = 0.0.0.0