I set up my first Ubuntu Server with Ubuntu 16.04, nginx, php7.0, MariaDB, nextcloud and external DynDNS using this tutorial here: Install Nextcloud 9 on Ubuntu 16.04
This last option worked for me (from quazgar). I have Ubuntu 18.10 installed with MariaDB 10.3.13:
$ echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld $ apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld $ systemctl restart mariadb
I had to use "sudo su" for it to work though.