如何从WAMP恢复MySQL数据库?

问题描述:

上个月,我不得不重新安装Windows,我已将 WAMP 文件夹移到另一个分区。现在我已经安装了WAMP,但我需要旧的数据库。如何从保存的WAMP文件夹中保存旧的MySQL数据库?

Last month I had to reinstall Windows and I've moved the WAMP folder to another partition. Now I've installed WAMP again but I need the old database. How can I take the old MySQL database from the saved WAMP folder on the safe partion?

在wamp / bin / mysql /../ data /我有我的旧数据库。如果我仅复制数据库文件夹,在 phpMyAdmin 中,我看不到所有的表/视图

In the wamp/bin/mysql/../data/ I have my old databases. If I copy the database folder only, in phpMyAdmin I can't see all the tables/views from the old database.

看起来您使用 InnoDB 表,因此您还应该在数据文件夹中复制ib *文件(但这将覆盖在新安装中创建的任何InnoDB表。)

Looks like you use InnoDB tables, so you should also copy ib* files in data folder (but this will overwrite any InnoDB table created in new installation.)

或者(甚至更好),您可以在配置文件中设置'datadir'参数,并在旧安装中指定数据文件夹的路径。

Alternatively (even better) you may set 'datadir' parameter in configuration file and specify path to data folder in old installation.