First off, you've exposed your DB details in the code screenshot. Please make sure you change the password for the explore database username.
You don't have Fail2Ban installed. The whitelisting in Fail2Ban is only to prevent blocking of the IP address in any of the configured jails. However, there isn't a jail for database connections.
In your case, your database port 3306 is most likely blocked or the database service is not listening on all interfaces.
In the firewall configuration, what do you have at
MySQL server:
View attachment 27709
As for the listening part, I have this output, meaning it's listening on all interfaces:
Bash:
# ss -natpl | grep 3306
LISTEN 0 90 0.0.0.0:3306 0.0.0.0:* users:(("mariadbd",pid=1202232,fd=67))
LISTEN 0 90 [::]:3306 [::]:* users:(("mariadbd",pid=1202232,fd=68))