Get the App
SLTechnology News&Howtos  ›  Database  › 

What if mysql causes the tmp directory to run out of space?

Shulou Source: shulou.com Published: 2022-05-31 11:36:00 11月16日 Update

This article is to share with you about what to do when mysql causes the tmp directory to run out of space. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Received the disk space alarm message, / tmp directory disk utilization 99%.

Mysql's tmpdir is set in the / tmp directory, check ls-alth for the first time and find large files, and there are no files such as mysql temporary tables.

Connect to mysql,show processlist and query for finding exceptions.

For the entire / tmp directory 8GB, check df-h to find that the / tmp Avail value is about 100MB; du-sh finds that only a few dozen MB are used in the tmp directory. Where is the extra space in 7GB? Not released?

Through lsof | grep tmp | more found that one of the mysql instances is similar to / tmp/MLXvlID8 (deleted)

Check the mysqld.err and find multiple lines: [ERROR] / mysql_base/bin/mysqld: Sort aborted

Guess: Sql terminated abnormally, resulting in sort aborted. Although files such as / tmp/ML* in the temporary directory are deleted, because the MySQL thread connection is a persistent connection, the thread still exists and the space will not be released for the time being.

To free up space:

1. Restart mysql

two。 Restart the application and disconnect the long connection.

Results:

The application restarts, the long connection is disconnected, and the deleted space is released.

Thank you for reading! This is the end of this article on "what to do when mysql causes tmp directories to run out of space?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Directories space files what to do content applications more disks programs articles threads applications good practical utilization information examples articles look knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei Linux Microsoft Xiaomi