MySQL Error Code 17?

I don't usually like to post asking for help, but over the last few weeks I've seen some variation of the following error on my server:

Can't create/write to file '#sql_5c90_0.MYD' (Errcode: 17)

The file name is usually different, but the Errcode (17) is always the same. A quick google search shows that MySQL error code 17 means that the file exists (so it can't be overwritten), but nothing I've found tells me a.) what the heck the file is or b.) why it already exists or c.) how to make sure it doesn't exist the next time the process tries to write to it.

Any MySQL gurus out there have an idea? If I do the good old 'reboot' the problem goes away (for a few days/hours anyways).

Comments
As a side note, it seems to affect only certain SELECT queries - and there is no rhyme or reason to the tables/databases that it affects. For example my blog is obviously functioning, but trying to display posts by category (http://cfsilence.com/blog/client/index.cfm?mode=ca... - or my RSS feed) will throw the error.
# Posted By todd sharp | 5/21/08 4:48 PM
a) You need to clear out your servers temp folder. If it doesn't get cleared out on a regular basis sometimes these files get left there and eventually MySQL will try to use that file name again but the file already exists and throws this error.
-or-
b) In older versions of MySQL this can be caused by the antivirus software on your server locking the files.
# Posted By Scott Bennett | 5/21/08 5:14 PM
If it's problem and it continues to happen you might want to schedule a batch process to clear the folder out on a regular basis.
# Posted By Scott Bennett | 5/21/08 5:17 PM
Also, sorry to bombard you with comments, but as a disclaimer, I am not a "MySQL Guru" per se, but I have experienced this problem before and clearing out the temp folder worked for me.

I'm not sure about if writing a batch process will help or not because I'm not sure exaclty why or how often MySQL tries to create these files with the same name. so trying to schedule something may not be practicle. I only that some "unknown to me" circumstance causes it to try to create these .MYD files that already exists and you have to delete the file from the temp folder to get it to work again.
# Posted By Scott Bennett | 5/21/08 5:40 PM
This is because of the rights problem on the temp directory.

This would be NTFS permissions or any AntiVirus software etc.

I would suggest to create a tmp directory under the MySQL directory and define this directory in my.ini for the parameter tmpdir.

If you have any AntiVirus software please try to add MySQL directory into exclude list.
# Posted By Oğuz Demirkapı | 5/21/08 8:19 PM
Repair the table.
# Posted By Gerald | 5/22/08 1:39 PM

Calendar

Sun Mon Tue Wed Thu Fri Sat
  12345
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31   

Subscribe

Enter your email address to subscribe to this blog.

Tags

actionscript ajax blogging cfsnippets coldfusion flash forms flex misc model-glue off topic personal project learn slidesix sql

Recent Comments

More CF+Java: Compiling Classes And Persisting Objects
Getburl said: I have been attempting to get Db4o working in my CF application and I have not succeeded. I would lo... [More]

Thoughts On Ajax Frameworks And ColdFusion/Adobe
Erast said: http://fanniecollins.10gb... emo http://gracetrevino.phree...... [More]

Extending Ext With Ext Extensions
Erast said: http://fanniecollins.10gb... emo http://gracetrevino.phree...... [More]

CF Needs An Open Source Contact List Importer
Kay Smoljak said: Heh, the fact that sites DO it doesn't mean they SHOULD. To us it's ok, but to a non-tech-savvy user... [More]

A Few Project Updates
Helena said: Now punctually what is the situation ? [More]

RSS


coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com