分类标签归档:MySQL

MySQL数据库结构同步工具


github上的MySQL数据库结构同步工具,真的很好用,还能自动生成升级脚本。如果能生成数据库差异报告就更好了,这样可以先评估变更的影响。

源代码网址:https://github.com/mmatuson/SchemaObject

运行结果:

python3 sync_mysql_schema.py mysql://xxx:xxxxx@localhost:3306/test1 mysql://xxx:xxxxx@localhost:3306/test2
=== start compare mysql db schema ===
** sync mysql schema from datab

全部内容

Python显示mysql执行计划脚本


网上的一个很牛的python脚本,用来分析mysql的执行计划,不过是python2写的,改了一下支持python3,并且支持数据库名.表名这种SQL写法

原文地址:https://dbaplus.cn/blog-77-736-1.html

执行结果如下: /usr/bin/python3 mysql_tuning.py -s "select count(*) from slow_db.dbinfo,slow_db.mysql_slow_query_r" 主要内容包括:

===== BASIC INFORMATION =====
===== ORIGINAL SQL TEXT ====

全部内容