从物理文件还原MySQL数据库 [英] Restoring MySQL database from physical files
问题描述
是否可以从物理数据库文件中还原MySQL数据库.我的目录具有以下文件类型:
Is it possible to restore a MySQL database from the physical database files. I have a directory that has the following file types:
client.frm
client.MYD
client.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屋!