Mysql – Importing a thesql database after drop filling up limited / in /tmp deleted file – A problem

centosMySQLmysql-5.1partitioning

I'm importing a fairly large set of databases into a system which has a / partition only 10GB large. After a previous failed import, I dropped the database, but noticed /var/lib/mysql didn't exactly empty out – Now I'm watching the root partition fill up with this file:

$ sudo lsof / | grep deleted
mysqld    53058     mysql   41u   REG  253,0 951599104   5523 /tmp/MLR7HVLj (deleted)

This file is growing large enough (2GB) that I'm starting to worry that it'll crash my system. Is this a known problem (Old centos 6 mysql version 5.1) with trying to import a database after it's been dropped already, and is mysql aware of limited space in the partition it's filling up with a deleted file?

Best Answer

SHOW FULL PROCESSLIST -- there is probably a complex query running, creating a huge tmp table.

Kill that process (go into mysql commandline tool, do SHOW PROCESSLIST to get the pid, then do kill, in the tool, with that number.)

Then scratch your head as to why it is taking so much room. A likely case:

SELECT ... FROM a, b;

and failing to restrict how a and b should be JOINed. This is called a CROSS JOIN; it can be huge.