# MysqlDiff **Repository Path**: icecooly/MysqlDiff ## Basic Information - **Project Name**: MysqlDiff - **Description**: 自动检测新旧库表的差异以及字段差异,方便升级项目时更新旧表 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-07-18 - **Last Updated**: 2024-04-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MysqlDiff 自动检测新旧库表的差异以及字段差异,方便升级项目时更新旧表 ## 安装 [需要python3.0以上] ```shell pip install MysqlDiff ``` ## 使用 ```python >>> from MysqlDiff import MysqlDiff >>> MysqlDiff.diff('127.0.0.1','root','password','db_test',3306,'127.0.0.1','root','password','db_test',3307) >>> ====================db1[db_test] difference============================ >>> miss table t_test >>> ====================db2[db_test] difference============================ >>> t_test2 miss column name ``` ```python >>> from MysqlDiff import MysqlDiff >>> MysqlDiff.diff('127.0.0.1','root','password','db_test',3306,'127.0.0.1','root','password','db_test',3307,['t_config']) >>> ====================db1[db_test] difference============================ >>> miss table t_test >>> ====================db2[db_test] difference============================ >>> t_test2 miss column name ``` ## ssh隧道 ```python >>> from MysqlDiff import MysqlDiff >>> MysqlDiff.diff('127.0.0.1','root','password','db_test',3306,'127.0.0.1','root','password','db_test',3307,['t_config'],True, 'ssh_host',ssh_port,ssh_username,ssh_password) >>> ====================db1[db_test] difference============================ >>> miss table t_test >>> ====================db2[db_test] difference============================ >>> t_test2 miss column name ```