从物理文件恢复 MySQL 数据库 [英] Restoring MySQL database from physical files

查看:40
本文介绍了从物理文件恢复 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 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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