virtual-machinefirewalloracle-cloud-infrastructure

I can't connect Mariadb remotely in Oracle Cloud


I allowed all access for oracle cloud.

inside firewall.

sudo iptables -P INPUT ACCEPT

outside firewall enter image description here

But i still can't access vm remotely. What I'm missing?


Solution

  • Ingress Rule Setup

    Networking -> Virtual cloud networks -> (select) -> Security List Details -> Ingress rules

    Ingress rule setup

    Make sure you have:

    Source Port Range: All
    Destination Port Range: 3306 (or your MYSQL/MariaDB port)
    Source CID: 0.0.0.0/0

    Firewall configuration

    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.