Search the MySQL manual:

A.2.12 Can't create/write to file Error

If you get an error for some queries of type:

Can't create/write to file '\\sqla3fe_0.ism'.

this means that MySQL can't create a temporary file for the result set in the given temporary directory. (The above error is a typical error message on Windows, and the Unix error message is similar.) The fix is to start mysqld with --tmpdir=path or to add to your option file:

[mysqld]
tmpdir=C:/temp

assuming that the `c:\\temp' directory exists. See section 4.1.2 `my.cnf' Option Files.

Check also the error code that you get with perror. One reason may also be a disk full error;

shell> perror 28
Error code  28:  No space left on device

User Comments

Posted by Scott Krabler on Wednesday February 19 2003, @10:27am[Delete] [Edit]

ERROR 1005 at line 17: Can't create table './scarab/some-tmp-table-name.frm' (errno: 150)

This error is also produced when attempting to create foreign keys when no index exists for the FK column name.

Posted by [name withheld] on Sunday April 20 2003, @3:03am[Delete] [Edit]

I had this problem importing a mysql dump, turns out it does not sort the tables at all then a forgin key references a non exsisting table.... (version 4.1a)

Posted by Alison Ngai on Monday April 28 2003, @12:38am[Delete] [Edit]

Can't create/write to file '/var/tmp/#sql181_197_1.MYI' (Errcode: 13)


After writing SQL statement, the above error occurs.
Do anything know why?

Posted by Boris Kester on Wednesday May 21 2003, @1:49am[Delete] [Edit]

I received errors like these (ERROR 1005: Can't create table './travel80_db/#sql-255_2.frm' (errno: 140)) when trying to alter a table (add a fulltext index) until I discovered that the problem was that I was trying to add a fulltext to blob fields, while the fulltext index can only be applied to text, varchar and char fields. So the problem can be somewhere else than you think it is.

Posted by Ruud van Melick on Sunday July 6 2003, @2:02pm[Delete] [Edit]

I got this error (MySQL-3.23.56) during a SELECT query:

ERROR 1030: Got error -1 from table handler

Several newsgroup postings suggested checking/repairing tables, but that wasn't the problem.
I found that the /tmp partition (TMPDIR) was 100% full (my fault). Freeing some space there solved it.

Add your own comment.