15 January,2020 by Rambler
Question: I've received an alert from a RHEL server with MariaDB installed. The alert refers to a MAD file filling the /tmp drive . What is going on? and how can I fix the mysql MAD file filling the /tmp drive?
Answer: This is a common problem when under certain circumstances - CREATE & ALTER statements executed on InnoDB tables create a temporary table in mysql's tmpdir.
To find out the current value check my.cnf or use SHOW VARIABLES LIKE "TMPDIR
During the data load phase MariaDB creates a temporary table in /tmp - which consequently fills the /tmp
The quick fix is to alter the tmpdir value in my.cnf and restart mysql . Find the directory which has enough disk space to support the load requirement.
Before you load the data you can check the tmpdir variable.
SHOW VARIABLES LIKE "TMPDIR";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| tmpdir | /tmp |
+---------------+-------+
1 row in set (0.01 sec)
Go to the my.cnf file and add\modify the tmdir variable. Ensure the entry is placed in the [mysqld] section.
Restart the mysql service : service mysql restart and check SHOW VARIABLES LIKE "TMPDIR";
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |