How to restore mysql database in XAMPP?(如何在 XAMPP 中恢复 mysql 数据库?)
问题描述
我有整个 xampp/mysql 文件夹的备份.如何在全新安装的 XAMPP 上使用它来恢复我的旧数据库?
I have a backup of the entire xampp/mysql folder. How can I use it to recover my old db on a fresh installation of XAMPP?
简单地将旧的 xampp/mysql 文件夹复制到新的 xampp 会导致以下 mysql 错误:
Simply copying the old xampp/mysql folder to new xampp leads to mysql errors like:
InnoDB:InnoDB 数据中的表 veno/sls37_finder_links_termsc字典的表空间 id 为 1171,但具有该 id 或名称的表空间不存在.您是否删除或移动了 .ibd 文件?这也可能是使用 CREATE TEMPORARY TABLE 创建的表,其 .ibd 和 .frm 文件MySQL 自动删除,但 InnoDB 中该表仍然存在内部数据字典.
InnoDB: Table veno/sls37_finder_links_termsc in the InnoDB data dictionary has tablespace id 1171, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary.
推荐答案
要将数据库恢复到 XAMPP,您需要以下这些东西:-.frm 、 .ibd 文件和 ibdata1 可以在 mysql/data 文件夹中找到
To restore your database to XAMPP these are the things you need: -.frm , .ibd files , and ibdata1 can be found in mysql/data folder
步骤
安装新的 XAMPP
Install New XAMPP
替换mysql/data中的ibdata1
Replace ibdata1 in mysql/data
复制要恢复的数据库的文件夹 [.frm 和 .ibd]并粘贴到 mysql/data 中
Copy the folders of the database you want to restore [.frm and .ibd] and paste in mysql/data
运行 mysql 和 Viola 就可以了!
Run the mysql and Viola it works!
如果出现#1932错误,只需导入create_tables.sql来自 xampp/phpMyAdmin/sql,这就解决了问题.
If there is an #1932 error occur, just import the create_tables.sql from xampp/phpMyAdmin/sql and this solves the problem.
这篇关于如何在 XAMPP 中恢复 mysql 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 XAMPP 中恢复 mysql 数据库?
基础教程推荐
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
