Updated: 11 October 2026 · Applies to: MariaDB 10.6 to 11.4 and MySQL 8

"Can't create new tempfile" during a repair usually means a temporary repair file is left over from an earlier attempt, or there is not enough free disk space.

Fix (root, VPS or dedicated server)

  1. Check free space: df -h /var/lib/mysql /tmp. Free some space if a disk is full.
  2. Look for a leftover .TMD file next to the table, for example /var/lib/mysql/shopdb/orders.TMD. Move it out of the way.
  3. Run the repair again: mysqlcheck -r shopdb orders.

If it still fails, stop the database server and repair the MyISAM table files directly, forcing the old temporary file to be overwritten:

myisamchk -r -f /var/lib/mysql/shopdb/orders.MYI

Note: Never run myisamchk while the database server is using the table. Back up the database folder first.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Managed cPanel VPS

cPanel included; we handle updates, security and monitoring.

Server management

on-demand administration, hardening, migrations and monitoring.

Was this answer helpful?

Still stuck? Open a ticket