重新安装Wamp时还原MySQL数据库 [英] Restoring MySQL Databases when reinstalling Wamp

查看:303
本文介绍了重新安装Wamp时还原MySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将旧数据库还原到新的Wamp安装.但是,在执行此操作之前,我没有备份Mysql文件.幸运的是,卸载并没有删除所有文件,但是在我的数据文件夹中,我有:

I am attempting to restore my old databases to a new Wamp installation. However, I did not take a backup of Mysql files before I did this. Thankfully the uninstallation has not deleted all the files, but in my data folder I have :

1)所有数据库(作为文件夹)

1) All the databases (As folders)

2)auto.cnf

旧文件夹中没有ib*文件.是否仍然可以以某种方式还原我的数据库?

There are no ib* files in the old folder. Is it still possible to restore my databases somehow?

我试图替换整个mysql5.6.17文件夹(安装之间版本没有更改),但是Wamp保持橙色,并且从未变为绿色.

I have tried to replace the entire mysql5.6.17 folder (there has been no change of version between the installations), but Wamp remains orange and never turns green.

如果仅替换数据文件夹,则MySQL服务将启动,我可以看到数据库,但不能看到表.

If I replace only the data folder, the MySQL service starts, I can see the databases, but not the tables.

如果我将my.ini中的路径更改为指向旧wamp的数据文件夹,则根本看不到旧数据库.

If I change the path in my.ini to point to the old wamp's data folder, I cannot see the old databases at all.

进行了一些尝试,将 database 文件夹直接复制到新的Wamp的 data 文件夹中,这使我可以获得所有列表表正确,但是表中没有实际数据,尝试使用MySQLWorkbench查询它会给我错误:

EDIT : Was experimenting a bit, copying the database folders directly into the new Wamp's data folder allows me to get a list of all the tables properly, but there is no actual data in the tables, and trying to query it using MySQLWorkbench gives me the error :

Error Code: 1146. Table 'testdb.users' doesn't exist

在我的数据文件夹中的错误日志文件中找到了此内容:

EDIT 2 : Found this in the error log file in my data folder :

2014-08-03 06:24:46 25164 [Warning] InnoDB: Cannot open table testdb/users from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.

正如我认为的那样,这是InnoDB自己的映射的问题.有办法手动解决吗?

As I thought, its a problem with InnoDB's own mapping. Is there a way to resolve this manually?

推荐答案

如果您创建了一个INNODB数据库,并且未进行其他配置更改以将实际数据存储在单独的表空间中,则该INNODB数据库的所有实际数据将具有已存储在\wamp\bin\mysql\mysql5.6.17\ibdata1文件中.

If you created an INNODB database, and made no other config changes to store the actual data in seperate table spaces then all the actual data for that INNODB databases will have been stored in the \wamp\bin\mysql\mysql5.6.17\ibdata1 file.

如果您没有旧安装中的文件,则数据将丢失.

If you do not have that file from the old install then your data is lost.

\wamp\bin\mysql\mysql5.6.17\data\DATA_BASE_NAME\文件夹中还将有一个信息,数据库中的每个表都有一个.frm文件,但这基本上只是架构信息,而不是实际数据.

There will also be info in a \wamp\bin\mysql\mysql5.6.17\data\DATA_BASE_NAME\ folder, one .frm file for each table that was in the database, but this is basically just schema information and not actual data.

为将来参考,请 InnoDB备份和恢复

这篇关于重新安装Wamp时还原MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆