Restoring MySQL database from physical files(从物理文件恢复 MySQL 数据库)
问题描述
是否可以从物理数据库文件中恢复 MySQL 数据库.我有一个包含以下文件类型的目录:
Is it possible to restore a MySQL database from the physical database files. I have a directory that has the following file types:
客户端.frm
客户.MYD
客户端.MYI
client.frm
client.MYD
client.MYI
但是对于大约 20 多张桌子.
but for about 20 more tables.
我通常使用 mysqldump 或类似的工具来获取 1 个 SQL 文件中的所有内容,那么处理这些类型的文件的方法是什么?
I usually use mysqldump or a similar tool to get everything in 1 SQL file so what is the way to deal with these types of files?
推荐答案
一个 MySQL MyISAM 表是三个文件的组合:
A MySQL MyISAM table is the combination of three files:
- FRM 文件是表定义.
- MYD 文件是存储实际数据的地方.
- MYI 文件是存储在表上创建的索引的位置.
您应该可以通过将它们复制到您的数据库文件夹中来恢复(在 linux 中,默认位置是 /var/lib/mysql/
)
You should be able to restore by copying them in your database folder (In linux, the default location is /var/lib/mysql/
)
您应该在服务器未运行时执行此操作.
You should do it while the server is not running.
这篇关于从物理文件恢复 MySQL 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从物理文件恢复 MySQL 数据库


基础教程推荐
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 在多列上分布任意行 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01