Link to home
Start Free TrialLog in
Avatar of thill1982
thill1982

asked on

MySQL ErrCode 17 - File Exists

I have a Windows Server 2003, Apache 2.2.2 and MySQL 5.0.21 system with a complicated PHP Moodle site on top.

MYD files are being left in the tmp folder which is causing "Can't create/write to file C:\xampplite\tmp\#sql_xxxx_0.myd' errors.  I have searched the web and tried many things that have worked for other people. I've installed APC caching. I've run an Analyze, Check, Repair and Optimize on the tables. I've given Everyone Full Control to the folder. I've uninstalled McAfee.

This is an in-house server, so we have full access to the server, but no hosting support. Can anyone help, even if it's suggestions or something to check?
Avatar of glcummins
glcummins
Flag of United States of America image

Are .MYD files the only ones being left, or do you also see .MYI files in the tmp folder?

Is upgrading an option, if this is determined to be a bug with the MySQL version?
Avatar of thill1982
thill1982

ASKER

If I keep a hawk eye on the folder I can sometimes catch MYI and MYD files appearing and disappearing as they are used. MYI files are never left behind though.

If it is a noted problem with .21 that is fixed with .37 then upgrading is a possibility. I'd rather avoid it otherwise as it's risking a semi-live server. I have not seen it mentioned in change logs though. Has anyone else?
This was a bug listed in an older version, but was supposedly fixed a long time ago: http://bugs.mysql.com/bug.php?id=11824

Here is a description of the bug from that page:

Very complex select statements can create temporary tables
  that are too big to be represented as a MyISAM table.
 
  This was not checked at table creation time, but only at
  open time. The result was an attempt to delete the
  "impossible" table.
 
  But if the server is built --with-raid, MyISAM tries to
  open the table before deleting the files. It needs to find
  out if the table uses the raid support and how many raid
  chunks there are. This is done with an open "for repair",
  which will almost always succeed.
 
  But in this case we have an "impossible" table. The open
  failed. Hence the files were not deleted. Also the error
  message was a bit unspecific.


Does this sound like it fits your situation? If so, I would definitely recommend upgrading.
Yes, although the symptons are slightly different in that both files were left behind. I'm only getting MYD files left.

The tables are MyISAM, and the server disks are RAIDed.
Solution found! While I thought I had uninstalled McAfee, the EPO policy had reinstalled it, but not so you could see it in the system tray. Once I added the exception to the folder and instructed EPO not to over-write client exceptions everything worked as it should.
Does Cleanup mean it will be deleted? Although I answered the question myself, this thread could help others in future.
Try to read the comment?
I will leave the following recommendation for this question in the Cleanup topic area:
   PAQ with points refunded

Which means what it says: The question will be saved and the points will be refunded to you.
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial