If you get an error of the following type for some queries, it means that MySQL cannot create a temporary file for the result set in the temporary directory:
Can't create/write to file '\\sqla3fe_0.ism'.
The preceding error is a typical message for Windows; the Unix message is similar.
One fix is to start mysqld with the
--tmpdir
option or to add the
option to the [mysqld]
section of your
option file. For example, to specify a directory of
C:\temp
, use these lines:
[mysqld] tmpdir=C:/temp
The C:\temp
directory must exist and have
sufficient space for the MySQL server to write to. See
Section 4.2.3.3, “Using Option Files”.
Another cause of this error can be permissions issues. Make
sure that the MySQL server can write to the
tmpdir
directory.
Check also the error code that you get with perror. One reason the server cannot write to a table is that the file system is full:
shell> perror 28
OS error code 28: No space left on device
If you get an error of the following type during startup, it indicates that the file system and/or directory used for storing data files is write protected. Providing the write error is to a test file, This error is not serious and can be safely ignored.
Can't create test file /usr/local/mysql/data/master.lower-test
User Comments
Please notice that antivirus programs may sporadically lock MySQL temporary files, and make the server to throw an “Can't create/write to file '/tmp/#sql_3a5_0.MYI' (Errcode: 13)”. I fixed the problem by excluding the MySQL temporary directory from antivirus scanning.
i fixed the problem by only including the fields that i needed in my select statement rather than *
ie i changed SELECT *
to SELECT FirstName, LastName
ERROR: Can't read/write to file...
i keep forgetting why it fails for me (i use windows and *nix), so heres what needs to be checked:
- antivirus interference (never caused me errors)
- use 'somefieldname' instead of * (never caused me errors)
- permissions (i've forgotten to give 'Everyone' Read & Write perms on windows, chmod 777 on *nix)
- give MySQL user FILE perms (CREATE USER MyDBconnecter...with FILE perms)
- $myroot=str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']);
(this last one often trips me up: the \ causes trouble on windows)
Hope this helps others,
Jon
Preconditions: arch 64bit,kde
Problem: on mysqld restart there was the following error:
./usr/sbin/mysqld: Can't create/write to file '/tmp/ibg6qcGT' (Errcode: 13)
071017 1:08:58 InnoDB: Error: unable to create temporary file; errno: 13
071017 1:08:58 [ERROR] bdb: /var/lib/mysql: Permission denied
071017 1:08:58 [ERROR] bdb: /var/lib/mysql/log.0000000001: Permission denied
071017 1:08:58 [ERROR] bdb: PANIC: Permission denied
071017 1:08:58 [ERROR] bdb: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
071017 1:08:58 [ERROR] bdb: fatal region error detected; run recovery
071017 1:08:58 [ERROR] bdb: /var/lib/mysql: Permission denied
071017 1:08:58 [ERROR] Can't start server : Bind on unix socket: Permission denied
071017 1:08:58 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
071017 1:08:58 [ERROR] Aborting
Solution:
I tried many things and read many thing but at the end I just went to the KUser (User Manager in kde),select mysql user and ticked into option Account Disabled and after it worked. It seems that that tick somehow refreshed the permissions.
Turning "off" the scanning of windows/temp folder in the anti-virus resolved the issue for me.
I was not getting the issue for all the queries, but for some of them and that too not always. The error occurred when a lot of temporary MYI files were being created, and the anti-virus 'locked' the folder for scanning, before it could be written by next query result.
Add your own comment.