In case you have ufw running, open access to port 3306 with the command;
ufw allow mysql
Change the bind parameter in the mariadb conf, wich might be /etc/my.cnf or /etc/mysql/my.cnf from 127.0.0.1 to 0.0.0.0 and restart mariadb