Skip to content

自动检测新旧库表的差异以及字段差异,方便升级项目时更新旧表

Notifications You must be signed in to change notification settings

icecooly/MysqlDiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MysqlDiff

自动检测新旧库表的差异以及字段差异,方便升级项目时更新旧表

安装

[需要python3.0以上]

pip install MysqlDiff

使用

>>> 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
>>> 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隧道

>>> 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

About

自动检测新旧库表的差异以及字段差异,方便升级项目时更新旧表

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages