• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

/var/tmp file system getting full due to Mariadb

by admin

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)]>

Filed Under: MariaDB

Some more articles you might also be interested in …

  1. How to use mysqldump without CREATE TABLE statements
  2. How to install and configure MariaDB in CentOS / RHEL 7
  3. How can I get Excel data into MySQL, or vice versa?

You May Also Like

Primary Sidebar

Recent Posts

  • ncat Command Examples in Linux
  • ncat: command not found
  • nautilus Command Examples in Linux
  • namei: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright