Home > Database > Mysql Tutorial > body text

Can I Restore My MySQL Database with Only .frm Files?

DDD
Release: 2024-11-04 03:22:02
Original
794 people have browsed it

Can I Restore My MySQL Database with Only .frm Files?

Retrieving Data from .frm Files for MySQL Database Restoration

You've realized that your weekly table dumps only include .frm files, leaving you without crucial .MYD and .MYI files. Your database uses the InnoDB storage engine. Is it feasible to restore your database with intact data using only the available .frm files?

Restoration Feasibility

Yes, it is possible to restore your database from .frm files with data intact. However, the process requires more than simply copying the .frm files to the database directory.

Comprehensive Recovery Procedure

Along with the .frm files, you must also copy the following files to the data folder:

  • ib_logfiles
  • ibdata

Completing the Restoration

After transferring these files, restart the server. Your database should be successfully restored.

Additional Command Execution

Once the files have been copied, execute the following command:

sudo chown -R mysql:mysql /var/lib/mysql
Copy after login

This command alters the file and folder ownership to the MySQL user, enabling MySQL to access the .frm and ibdata files.

The above is the detailed content of Can I Restore My MySQL Database with Only .frm Files?. For more information, please follow other related articles on the PHP Chinese website!

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