Home > Database > Mysql Tutorial > body text

mysql数据库恢复(*frm)文件_MySQL

WBOY
Release: 2016-06-01 13:09:50
Original
969 people have browsed it


在使用虚拟服务器时,服务器提供商一般不会像我们使用本地数据库一样:使用导入导出(这样的文件后缀是*.sql)。大部分时候提供的是一个文件夹,里面包括:数据库名文件夹,文件夹里包括,*.frm,*.MYI,*.MYD,并且包含一个db.opt文件。分别介绍一下:
    *.frm----描述了表的结构
    *.MYI----表的索引
    *.myd----保存了表的数据记录
    db.opt----用文本编辑器打开,可以看到里面保存的是编码信息

要把上述的数据库导入进mysql:

  1. 安装mysql数据库:我安装的数据库是MySQL Server 5.5,安装目录选择:D:/program files/MySQL  (注意:路径中不要包含中文)   
  2. 在C:/Documents and Settings/All Users/Application Data/  里找到 MySQL/MySQL Server 5.5文件夹,该文件夹下有个文件: my.ini 
  3. 在my.ini文件里找到一个datadir的key如:datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.5/data/“   
  4. 在3找到的一个data文件夹下,拷贝服务商提供备份时提供的文件(包括*.frm,*.MYI,*.MYD,db.opt)   
  5. 一般重启mysql服务,在管理界面就可以看到表的结构及数据了


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!