ERROR 1017 (HY000): Can't find file: 'tablename' (errno: 2)

简介:

系统因为突然断电,导致查询mysql数据时老是失败。报ERROR 1017 (HY000): Can't find file: 'tablename' (errno: 2)这个错误。

  使用正常的修复表的操作对其进行修复,则查询报相同的错误,修复表失败。

  仔细查看一下,这个表的数据文件,发现了问题。由于这个表做了分区,发现有个别的分区和其它的不一样:

  tablename#P#temp#p20170919.MYD

  tablename#P#temp#p20170919.MYI

  分区文件中多了一个“#temp”,将其重命名为正常的名字后,查询该表正常了。推测是程序在对分区操作的过程中正好断电了,导致分区异常。



 本文转自 XDATAPLUS 51CTO博客,原文链接:http://blog.51cto.com/xdataplus/1966541

目录
打赏
0
0
0
0
344
分享
相关文章
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
1163 0
|
10月前
|
syntax error: unexpected end of file
syntax error: unexpected end of file
46 0
SQLSTATE[HY000]: General error: 1364 Field ‘xxx’ doesn't have a default value 解决办法
SQLSTATE[HY000]: General error: 1364 Field ‘xxx’ doesn't have a default value 解决办法
2208 0
Error:fatal error C1010: unexpected end of file while looking for precompiled head
Error:fatal error C1010: unexpected end of file while looking for precompiled head
140 0