MySQL Differ

MySQL Differ is a purely PHP-driven MySQL diff utility; It creates emulated databases for two imported ones and compares them without using an actual database.

MySQL Differ can be used in a few different ways.

Online SQL Diff Utility

You may import your databases or tables by SQL file, text, or direct database connection. MySQL Differ will emulate a table structure for each table and compare the two of them. MySQL Differ will provide a visual and verbose explanation of the differences as well as give you the MySQL to sync/update the second table.

Because MySQL Differ relies on an emulated schema structure, it does not require database access to run (though, you can use it if you really want to), and because it doesn't require database access, it works well as an online tool that you don't have to download.

Embed the Module

If you are so inclined, you can embed the tool you see above into your own website by adding the following markup to your page.

<iframe src="" style="overflow-x: hidden; width:97%; max-width:97%; margin:0 auto; min-height:35em; border:0;"></iframe>

Webservice API

Yes, there's an API too. Here's a short list of endpoints.

Get an exported object from SQL string
POST paramsdo = "import", from = "sql", sql = Arbitrary SQL string

Get an exported object from database
POST paramsdo = "import", from = "db", host = DB Host Name, user = DB User Name, pass = DB Password, dbname = DB Name

Diff two exported schemas.
POST paramsdo = "diff", schema1 = Exported Schema, schema1 = Exported Schema

Download the Source

You can download a zip containing the complete source code, including the API, widget, and library files.

Download MySQLDiffer


This library implements the PHP-SQL-Parser library.


Apache Lic. 2.0. You may not resell or redistribute, for personal use only. No warranties implied or implicit. Use at your own risk.

Note: the PHP-SQL-Parser library is included in this package. See the link above for licensing info.

All rights reserved. © Rob Parham 2015