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
FYI:
In my case neither the solution of Vincent or Lw Bi worked exactly, I needed some further actions.
Disabling the profile through placing a link in /etc/apparmor.d/disable/
simply didn't work, I don't know why.
On the other hand, setting MySQL to complain mode didn't work either immediately.
:~$ sudo aa-complain /usr/sbin/mysqld
Setting /usr/sbin/mysqld
to complain mode.
ERROR: /etc/apparmor.d/usr.sbin.mysqld contains no profile
I needed to add the lines:
/usr/sbin/mysqld {
}
to /etc/apparmor.d/usr.sbin.mysqld
, and then I could set it to complain mode successfully.