Skip to content

Commit 131a250

Browse files
committed
chore: add mysqldbcompare
1 parent 0a6eb45 commit 131a250

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

content/blog/top-mysql-schema-compare-tools.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ Database schema compare tool enables you to identify differences in the object s
1616
- Deploy database schema changes to production based on application requirements
1717
- Troubleshoot database problems when the service is down
1818

19+
## mysqldbcompare
20+
21+
[mysqldbcompare](https://github.com/mysql/mysql-utilities/blob/master/scripts/mysqldbcompare.py) is a command-line utility from MySQL Utilities that compares the structure and data of two databases. It identifies differences in tables, views, stored procedures, triggers, and other database objects, and can generate SQL statements to synchronize them. The tool supports comparing databases across different servers or on the same server, with options to control comparison depth, output format, and which server's schema should be considered authoritative.
22+
23+
A typical workflow:
24+
25+
1. Use `mysqldump --no-data --routines --triggers` to create schema-only snapshots
26+
1. Version control these snapshots
27+
1. Utilize `mysqldbcompare` to compare schemas and generate diff migration scripts
28+
1. Organize migration scripts with naming convention (e.g., `V1.0.1__description.sql`)
29+
1. Deploy migration scripts
30+
1931
## MySQL Workbench
2032

2133
[MySQL Workbench](https://dev.mysql.com/doc/workbench/en/) is the official GUI for MySQL development from Oracle. It includes schema comparison and synchronization utilities. It enables you to compare and synchronize schema between models, databases and SQL files. These three types can be the destination, source, or both. The following figure shows the source is model and the destination is database.

0 commit comments

Comments
 (0)