Mysql文件备份

Mysql文件备份

我将我的网站从 Windows 2003 移至 Windows 2008 Web 服务器。我有一些 php 论坛,我将 mysql 的数据目录从旧服务器复制到新服务器。当我通过 PHPmyadmin 检查时,我看到一些数据库有 230 个表,但是当我尝试查询某些表时,我遇到错误消息:TABLE NAMe 不存在。我检查数据文件夹,发现 frm 文件存在。在日志文件中,我看到此错误消息:

Log Name:      Application
Source:        MySQL
Date:          07/11/2010 01:34:47 ب.ظ
Event ID:      100
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      00000
Description:
Cannot find or open table 00000/datastore from
the internal data dictionary of InnoDB though the .frm file for the
table exists. Maybe you have deleted and recreated InnoDB data
files but have forgotten to delete the corresponding .frm files
of InnoDB tables, or you have moved .frm files to another database?
or, the table contains indexes that this version of the engine
doesn't support.
See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html
how you can resolve the problem.


For more information, see Help and Support Center at http://www.mysql.com.  
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="MySQL" />
    <EventID Qualifiers="49152">100</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2010-07-11T09:04:47.000000000Z" />
    <EventRecordID>48742</EventRecordID>
    <Channel>Application</Channel>
    <Computer>vmi386</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Cannot find or open table npshopforum/datastore from
the internal data dictionary of InnoDB though the .frm file for the
table exists. Maybe you have deleted and recreated InnoDB data
files but have forgotten to delete the corresponding .frm files
of InnoDB tables, or you have moved .frm files to another database?
or, the table contains indexes that this version of the engine
doesn't support.
See http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html
how you can resolve the problem.

有没有办法可以恢复这些数据库

答案1

这个问题已经被问过很多次了,总结如下:

转储和加载。例如,将数据库从原始文件转储到文件,然后将其加载到新机器中。

使用文件副本进行 MySQL 迁移可以成功,但通常会导致问题。如果您使用 Innodb 表,情况尤其如此。当然您现在已经知道这一点了。

相关内容