$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
$ sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://ftp.utexas.edu/mariadb/repo/10.3/ubuntu bionic main'
$ sudo apt-get update
$ sudo apt-get install mariadb-server -y
$ mysql -V
$ sudo mysql_secure_installation
$ sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf
edit or add
bind-address
127.0.0.1 to 0.0.0.0
$ sudo systemctl restart mariadb.service
$ sudo netstat -anp | grep 3306
$ sudo mysql -u root
enter password:
...
Grant All Privileges ON *.* to 'admin'@'%' Identified By 'password';
$ mysql -u database_user -p database_user_password -h database_server
Set Firewall
$ sudo ufw allow from <ip> to any port 3306
or
$ sudo ufw allow 3306/tcp
Not suggest because not allow all IP addresses not secure