Question

how to recover DB files from an image

We had a server issue and had to rebuild a site from an image taken just before the crash happened. we can recover the code but the .frm files are giving error #1017. Any ideas on what we’re doing wrong?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I’d suggest giving two things a try:

1. Check Permissions

Make sure that your MySQL data directory and all the files in it are owned by mysql user and mysql group. This may not be the case if you copied the files onto your local test machine as root user:

chown -R mysql:mysql your-mysql-data-dir-here

2. Repair corrupted tables

Use mysqlcheck to check for corrupted tables and repair them if it finds any:

mysqlcheck -u root -p --auto-repair --all-databases

If you still can’t use the tables after that then give mysqldump a go!