3.1.4 How Can I Tell If a Table on Server X has the same Structure as the Same Table on Server Y?

3.1.4.1 Objectives
3.1.4.2 Example Execution
3.1.4.3 Discussion
3.1.4.4 Permissions Required
3.1.4.5 Tips and Tricks

Multiple database servers that are kept synchronized manually or are compartmentalized for security purposes but are by practice kept uptodate manually are prone to unintentional (and sometimes intentional) divergence.

For example, you may maintain a production server and a development server. The development server may have the same databases and the same structures as the production server (but maybe not the same data). However, the natural course of administrative tasks and maintenance can sometimes leave the development server behind.

When this happens, you need to have a way to quickly check the schema for a table on the production server to see if the development server has the same structure. The utility of choice for this operation is mysqldiff.