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沒有出現相似錯誤。或許,問題已經解決。

相關文章
相關標籤/搜索