MySQL创建临时表错误 [英] MySQL CREATE TEMPORARY TABLE Error
问题描述
我正在运行带有MySQL 5.5.27日志的EasyPHP 5.4.6.
I'm running EasyPHP 5.4.6 with MySQL 5.5.27-log.
当我尝试使用以下方法创建临时表时:
When I try to create a temporary table using the following:
CREATE TEMPORARY TABLE temp_table (x int);
我收到以下错误:
ERROR 1005 (HY000): Can't create table 'temp_table' (errno: 22)
但是,如果我删除了"TEMPORARY",它会起作用.
However, it works if I remove the "TEMPORARY".
临时表的语法是从示例页面逐字复制的.我尝试使用Google搜索错误号,但是却无法使用.
The syntax for the temporary table was copied verbatim from an example page. I tried googling the error numbers, but that yielded nothing I could use.
有人能想到会发生什么吗?
Can anyone think of what may be going on?
推荐答案
errno:22表示MySQL正在尝试访问路径无效的文件(fopen-> INVAL). MySQL不太可能生成无效路径,因此请检查是否正确设置了临时路径.如果您在MySQL配置中有一个自定义设置tmpdir,请确保它是有效路径.如果不是,请使用SHOW VARIABLES LIKE '%tmp%'
检查当前值;如果不正确或缺少某些内容,请检查系统的TEMP环境变量是否已正确设置.有关更多信息,请检查 http://dev.mysql.com/doc/refman/5.5/en/temporary-files.html .
errno: 22 indicates that MySQL is trying to access a file with an invalid path (fopen -> INVAL). MySQL is not likely to generate an invalid path, so check that your temp path is set correctly. If you have a custom set tmpdir in your MySQL configuration, make sure it's a valid path. If not, check the current value using SHOW VARIABLES LIKE '%tmp%'
; If something is incorrect or missing, check that your system's TEMP environment variable is set properly. For more info, check http://dev.mysql.com/doc/refman/5.5/en/temporary-files.html.
这篇关于MySQL创建临时表错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!