1

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
2
  • Please add the /home permissions (ls -ld /home), the /home/mysqltmp/ibm7cVN0 permissions (ditto) and the user/group runing the MySQL server (see inside my.cnf file). Also, check if filesystem has enough free space and inodes (df -h and df -hi), and if is mounted rw (mount or findmnt or cat /proc/mounts)
    – JucaPirama
    Apr 4, 2019 at 3:23
  • Those are probably mysql and mysql.
    – Rick James
    Apr 21, 2019 at 23:14

1 Answer 1

1

I think this could be UMASK values. Please check umask.

To change the default UMASK value, start mysqld_safe as follows:

$ UMASK=384  # = 600 in octal
$ export UMASK
$ mysqld_safe &

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:

$ UMASK_DIR=504  # = 770 in octal
$ export UMASK_DIR
$ mysqld_safe &

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .