MySQL: Temporary table storage location

MySQL

I have been reading about temporary tables and how if you exceed tmp_table_size, it is converted on an on-disk MyISAM table. What I can't find is where that table is stored. I assume it's the MySQL datadir. Can anyone confirm this?

Best Answer

The variable is called tmpdir and has a system default of /tmp, /var/tmp or /usr/tmp.

You should note though the paragraph about hidden files. You won't be able to actually see the files/tables on disk during operation. And that ALTER TABLE behaves slightly differently.