Caused by: java.sql.SQLException: Can't create/write to file 'C:\WINDOWS\TEMP#sql_15bc_0.MYI' (Errcode: 17)

如果看到以上错误,可能的原因是:
1.文件已经存在,需要清空一下目录,这种情况应该很少见
2.文件目录没有写入权限,NIX下更有可能,Windows下没这种权限设置

3.反病毒程序作怪。 

[quote] 

Cannot replicate problem on my Windows XP SP2 desktop using 5.0.26. Desktop is a single 

processor hyper-threaded whereas affected server is a dual processor hyper-threaded FWIW. 


Saw faster performance of the SHOW FIELDS script on XP. Lead me to suspect that something 

was interfering with the temporary files. XP desktop had no virus scanner, server was 

running McAfee 8.5. Excluded Windows\Temp and problem was resolved. 

[/quote]


mysql产生临时文件有几种情况,mysqldump时、读取meta data时。
今天新安装一个jira做测试时碰到以上问题,服务器上正好有Mcafee,第一次运行jira时是没有问题的,因为数据库表还不存在,没有去获取表的字段信息,第二次启动时就报错了。
[url]http://confluence.atlassian.com/pages/viewpage.action?pageId=104300807[/url] 这篇文章说可能是jdbc driver不一致,但errorcode是13,不是我碰到情况。

[url]http://bugs.mysql.com/bug.php?id=25872[/url]
这个才是真正的原因。
重复一下解决办法:[b]在mcafee的按访问属性扫描-所有进程-检测项-不扫描的内容中添加排除项。[/b]
更改mysql产生临时文件的路径或许能生效,但my.ini中tmpdir配置无效,不知为何。