MySQL Errcode: 17

服务器安装的MySQL老是会在一段时间以后中止服务。若是只是从表现来看,很难定位问题。最好的办法是查看日志。打开err文件,发现每过一段时间,就会打印一条错误信息:mysql

\bin\mysqld-nt: Can't create/write to file 'C:\WINDOWS\TEMP\ib88' (Errcode: 17)sql

InnoDB: Error: unable to create temporary file; errno: 17服务器

看来是InnoDB在建立临时文件的时候出现了错误。但这个目录的权限设置是没有问题的,当前用户能够对其进行读写。ide

MySQL的官方网站这样解决这个问题:网站

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: this

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

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: code

[mysqld]
tmpdir=C:/temp server

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.

时间紧迫,我也没有闲情去琢磨发生此问题的缘由了。在另外一个盘下建立了temp临时目录,并在my.ini中添加:

[mysqld]
tmpdir=e:/temp

已经运行了12个小时,MySQL没有出现相似错误。或许,问题已经解决。

相关文章
相关标签/搜索