I allowed all access for oracle cloud.
inside firewall.
sudo iptables -P INPUT ACCEPT
But i still can't access vm remotely. What I'm missing?
Networking -> Virtual cloud networks -> (select) -> Security List Details -> Ingress rules
Make sure you have:
Source Port Range: All
Destination Port Range: 3306
(or your MYSQL/MariaDB port)
Source CID: 0.0.0.0/0
Replace 3306 with your MYSQL/MariaDB port
Open the port with UFW:
sudo ufw allow 3306
Open the port with firewalld:
sudo apt install firewalld
sudo firewall-cmd --zone=public --permanent --add-port=3306/tcp
sudo firewall-cmd --reload
If nothing works, try the firewalld method since it what finally worked for me.