MySQL Comparer is a powerful GUI application that allows users to track and compare changes in MySQL databases. It captures the state of database tables at specific points in time, compares them to the current state, and highlights all differences. This tool is ideal for database administrators, developers, and QA specialists who need to monitor and validate database changes during development, testing, or migration processes.
- ✅ Complete Database Comparison – Tracks additions, modifications, and deletions across all tables
- ✅ High Performance – Optimized for large databases with batched processing and connection pooling
- ✅ Fast Mode – Optional in-memory processing for faster comparisons on powerful systems
- ✅ Table Selection – Ability to focus comparison on specific tables of interest
- ✅ Advanced Filtering – Filter results by table, column, or value changes
- ✅ Color-Coded Results – Visual differentiation between added, modified, and deleted data
- ✅ Pagination – Efficiently navigate through large result sets
- ✅ Export Options – Save comparison results to CSV or copy to clipboard
- ✅ Configurable Settings – Customize database connections and display preferences
Before running the application, ensure you have the following installed:
- Python 3.x
mysql-connector-pythontkinter(built-in with Python)configparser
Install missing dependencies using:
pip install mysql-connector-python-
Clone the repository:
git clone https://github.com/saymonn37/MySQL-Comparer.git cd MySQL-Comparer -
Create a
config.inifile in the root directory with the following structure:[mysql] host = your_mysql_host user = your_mysql_user password = your_mysql_password database = your_database_name pool_size = 5
Note: The application will create a default config file on first run if none exists.
-
Run the script:
python3 mysql_comparer.py
- Fetch State – Click the "Fetch State" button to capture the initial database state
- Make Changes – Modify your database through your normal tools and applications
- Compare States – Click "Compare States" to analyze differences between the initial and current state
- Export Results – Save the comparison results as CSV or copy to clipboard
- Clear All – Reset the application to start a new comparison
- Table Selection – Use Options → Select Tables to focus on specific tables
- Fast Mode – Enable for faster processing (requires more RAM)
- Filtering – Use the filter box to search for specific changes
- Pagination – Navigate through results using the pagination controls
- Stop Button – Cancel long-running operations
The application consists of:
- Control Panel – Buttons for fetching state, comparing, exporting, and clearing data
- Filter Bar – Tools to search and filter comparison results
- Results Table – Displays detected changes with color-coding:
- Green – Added records
- Orange – Modified records
- Red – Deleted records
- Status Bar – Shows operation progress and current status
When a database change is detected, the following information is displayed:
| Table | ID | Column | Column Name | Old Value | New Value |
|---|---|---|---|---|---|
| users | 1 | 2 | username | JohnDoe | John_Doe |
| orders | 5 | 4 | status | pending | shipped |
Access additional settings through the Options → Settings menu:
- Database Settings – Configure connection parameters
- Display Settings – Customize page size and result highlighting colors
- If MySQL credentials are incorrect, an error message will be displayed
- Connection issues are logged to an error.log file
- Long-running operations can be canceled using the STOP button
- Support for other database systems (PostgreSQL, SQLite, Oracle)
- Differential backups based on comparison results
- Schema change detection and comparison
- SQL script generation for synchronizing databases
- Dark mode for reduced eye strain
| Issue | Solution |
|---|---|
| Connection errors | Verify credentials in config.ini and ensure the database server is running |
| Application seems slow | Consider enabling Fast Mode for performance or select only necessary tables |
| High memory usage | Disable Fast Mode if experiencing memory issues on large databases |
| No changes detected | Ensure you've properly fetched the initial state and that changes were actually made |
This project is open-source under the MIT License.
Developed by Saymonn. Contributions and feedback are welcome!
