This configuration may be not safe for production! Use with warning.
pkg update
pkg install mariadb105-client mariadb105-server
echo 'mysql_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/mysql/conf.d/server.cnf
# In section [mysqld]:
bind-address = YOUR_OUTSIDE_ADDRESS
# From mysql query:
CREATE USER myuser;
CREATE DATABASE mydatabase;
USE mydatabase;
CREATE TABLE mytable (
id MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
text VARCHAR(50)
);
# From mysql query:
GRANT SELECT, INSERT ON mydatabase.* TO myuser@'%' IDENTIFIED BY 'my-password' WITH GRANT OPTION;