By default MariaDB will create temporary table structure in /var/tmp and this fills up space of root file system(/). We can change default setting by assigning a custom temp directory in ‘[mysqld]‘ section in my.cnf file.
MariaDB creates temporary table structure in tmpdir(/var/tmp) directory when there are huge/bulk inserts into table. By default, MariaDB will create temporary table structure in /var/tmp directory. To change the default setting, add a variable tmpdir in [mysqld] section in my.cnf file which points to directory of your choice.
1. If MariaDB software is installed from Software collections repository, tmpdir variable is added in /etc/opt/rh/rh-mariadb-[version]/my.cnf file instead of /etc/my.cnf.
$ cat /etc/opt/rh/rh-mariadb102/my.cnf [mysqld] tmpdir=/data/mysql/tmp
2. If MariaDB software is installed from Base repository, tmpdir variable is added in /etc/my.cnf file as above. To confirm setting execute following mysql query.
$ mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.2.8-MariaDB MariaDB Server Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show variables like 'tmpdir'; +---------------+-----------------+ | Variable_name | Value | +---------------+-----------------+ | tmpdir | /data/mysql/tmp | +---------------+-----------------+ 1 row in set (0.00 sec) MariaDB [(none)]>