Ubuntu newbie. I struggled on pointing a MySQL datadir to a mounted FAT32 volume.
I tried to edit the /etc/apparmor.d/usr.sbin.mysqld configurations to point to the mounted location, to no avail.
Changing the umask mount parameter for the fat volume was also without effect.
So I disabled apparmor for mysqld, as suggested in this thread.
... Now this alone did not do the trick.
I found that the problem lied in that I had declared the location on the mounted volume directly in the my.cnf datadir.
After creating a symlink from /var/lib/mysql to the mounted datadir, I could start the mysqld server:
sudo ln -s /opt/data/mysql5 /var/lib/mysql/mysql5
Note: I tried without success to chown the symlink to mysql:mysql, still it worked, somewhat mysteriously (I initially assumed that the datadir location has to be owned by the mysql user, but it doesn't seem to be the case).
Mounting option for the vfat volume are:
Hope this will help.