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 is what worked for me:
The correction didn't work for me.
$ sudo aa-complain /usr/sbin/mysqld Setting /usr/sbin/mysqld to complain mode.
ERROR: /etc/apparmor.d/usr.sbin.mysqld contains no profile So I disabled the profile (with aa-disable which seems to be equivalent to plutocrat's solution)
$ sudo aa-disable /usr/sbin/mysqld Disabling /usr/sbin/mysqld. I disabled mysqld-akonadi and mysqld-digikam as well.
An apparmor reload was not enough, so I had to reboot and mariadb started perfectly well.
Source: https://askubuntu.com/a/964928/106100