"SQL Error: 13: Can't create/write to file" on other then /tmp directories (apparmor)

If you get SQL Error: 13 after changing tmpdir parameter in you my.cnf first check permissions in a new directory. If permissions are correct you might be having an issue with AppArmor. AppArmor is a GNU security module for the Linux kernel and it might prevent MySQL from writing to the new directory.
Run: aa-status
To verify if it`s on. If so you will get something like:
profiles are loaded
profiles are in enforce mode
Edit this file:
and append your new temp directory in the end.
/usr/sbin/mysqld {
/new_tmp/ r,
/new_tmp/* rw,
Reload AppArmor with:
/etc/init.d/apparmor reload
Thats it.


Popular posts from this blog

How to set or disable auto-logout on bash shell

Setting up updates with public yum server for Oracle Enterprise Linux

Setting Filezilla Server on Amazon EC2 instance with passive ftp