MySQL Diff Tool
Compare two MySQL schemas or mysqldump files side by side. Runs in your browser — your schema is never uploaded.
Compare two MySQL schemas
Comparing MySQL schemas between environments
The classic MySQL problem is that staging and production have quietly diverged. Someone applied a hotfix directly to production months ago, an index was added by hand during an incident, or a migration failed halfway and nobody noticed. The result is a deploy that works everywhere except the one environment that matters.
Dumping both schemas and diffing them takes about a minute and tells you exactly where they parted company.
Producing comparable dumps
The important part is stripping the parts of a dump that change every time you run it. Without these flags, every comparison is dominated by timestamp and version differences:
mysqldump --no-data --skip-comments --skip-dump-date \ -u user -p staging_db > staging.sql mysqldump --no-data --skip-comments --skip-dump-date \ -u user -p production_db > production.sql
Paste the two files into the panes above. AUTO_INCREMENT counters will still differ between environments and are usually noise — you can ignore those rows, since they reflect row counts rather than structure.
What to look for in the output
Column type changes and nullability changes are the ones that break deploys, so scan for those first. Differences in character set or collation are worth attention too: a table created as latin1 on one server and utf8mb4 on another will behave differently under comparison and sorting, often in ways that only surface with non-English data.
Missing indexes rarely break correctness but frequently explain why a query that is fast in staging times out in production.
Frequently asked questions
How do I compare two MySQL schemas?+
Export each schema with mysqldump using the --no-data flag, then paste the two dumps into the panes above. Differences in tables, columns, indexes and constraints are highlighted line by line.
How do I export a MySQL schema without the data?+
Run: mysqldump --no-data --skip-comments --skip-dump-date -u user -p dbname > schema.sql. The --skip-comments and --skip-dump-date flags matter, because without them every dump differs by timestamp and version banner and the comparison fills with noise.
Will this generate the ALTER TABLE statements to sync the schemas?+
Not currently. This tool shows you what differs; it does not yet emit migration SQL. For automated schema synchronisation, dedicated tools such as Liquibase, Flyway, Atlas or Percona Toolkit are the right choice.
Can I compare a single table definition?+
Yes. Run SHOW CREATE TABLE on each database and paste the two results in. This is often quicker than dumping the whole schema when you already know which table is suspect.