My main volume is a 20GB SSD disk mounted on /. I have a 4TB HDD mounted in /home. So to save space I want to set the mysql temporary directory to /home/mysqltmp.
However when I set to this directory mysql won't start. I get error:
mysqld: Can't create/write to file '/home/mysqltmp/ibm7cVN0' (Errcode: 13 "Permission denied")
I checked the permission and it is correct:
# ls -ld /home/mysqltmp/
drwxrwxrwx 2 mysql mysql 4096 Apr 4 03:19 /home/mysqltmp/
Running mysqld as root it starts without problem.
Server:
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
Note: Problem arose after updating to 16.04, was working on 14.04
MySQL details:
# mysql -V
mysql Ver 15.1 Distrib 10.1.38-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
I think this could be UMASK values. Please check umask.
To change the default UMASK value, start mysqld_safe as follows:
By default, MySQL creates database directories with an access permission value of 0750. To modify this behavior, set the UMASK_DIR variable. If you set its value, new directories are created with the combined UMASK and UMASK_DIR values. For example, to give group access to all new directories, start mysqld_safe as follows: