3.2.2 My Server Crashed! I Need to Know the Structure of a Table. How Can I Do That?

3.2.2.1 Objectives
3.2.2.2 Example Execution
3.2.2.3 Discussion
3.2.2.4 Permissions Required
3.2.2.5 Tips and Tricks
3.2.2.6 Risks

When things go wrong badly enough that your server is down, but you can still access the disks, you may find yourself faced with a number of complex recovery tasks.

One of those is the need to discover the structure of a particular table or set tables. Perhaps this is needed for an emergency recovery, a redeployment, or setup for a forensic investigation. Whatever the case, without a running MySQL server it is not possible to know the structure of a table unless you keep meticulous notes and/or use some form of high availability (redundancy).

Fortunately, there is a utility for situations like this. The mysqlfrm utility can be used to discover the structure of a table.