Restoring a MySQL Database Using .frm Files
When performing regular database backups, it is crucial to capture the entirety of the database structure and data. However, in some instances, users may only have access to the .frm files, which represent the table structure but not the actual data. In this scenario, restoring the database with its data using only the .frm files can be challenging.
Fortunately, it is possible to recover a database from .frm files in certain situations. If the database is using the InnoDB storage engine, additional steps can be taken to reconstruct the database with its data.
Procedure:
Adjust File Ownership: Execute the following command to change the file ownership of the MySQL data directory to the mysql user:
sudo chown -R mysql:mysql /var/lib/mysql
This will allow MySQL to properly read the .frm and ibdata files.
By following these steps, it is possible to restore a MySQL database with its data using only .frm files. This process is particularly useful when other forms of backup (such as .MYD and .MYI files) are unavailable.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3