美文网首页
MySQL对比同步表结构

MySQL对比同步表结构

作者: 袁先生的笔记 | 来源:发表于2021-09-01 15:02 被阅读0次

安装mysqldiff

yum install -y mysql-utilities

对比

  • 对比库
mysqldiff --server1=user:pass@10.0.0.1:3306 --server2=user:pass@10.0.0.2:3306 db1:db2
  • 对比表
mysqldiff --server1=user:pass@10.0.0.1:3306 --server2=user:pass@10.0.0.2:3306 db1.table1:db2.table1
  • 常用参数
  --skip-table-options  skip check of all table options (e.g., AUTO_INCREMENT,
                        ENGINE, CHARSET, etc.).

  -d DIFFTYPE, --difftype=DIFFTYPE
                        display differences in context format in one of the
                        following formats: [unified|context|differ|sql]
                        (default: unified).

  --show-reverse        produce a transformation report containing the SQL
                        statements to transform the object definitions
                        specified in reverse. For example if --changes-for is
                        set to server1, also generate the transformation for
                        server2. Note: the reverse changes are annotated and
                        marked as comments.

相关文章

  • MySQL对比同步表结构

    安装mysqldiff 对比 对比库 对比表 常用参数

  • mysql表结构同步

    同步两张表之间的表结构。 模仿navict中同步数据库功能。 适合于开发和测试环境之间同步表结构使用 ,修改表结构...

  • 12-mysql

    难点:表空间 redo/undo 半同步复制 高可用 MySQL架构原理和存储机制MySQL体系结构(内存结构...

  • MySQL Utilities报错Variable 'f

    今天在用MySQL Utilities工具集里的mysqldbcopy同步表结构时,报错了:ERROR: Quer...

  • MySql之自动同步表结构

    MySql之自动同步表结构 开发痛点 在开发过程中,由于频繁的修改数据库的字段,导致rd和qa环境的数据库表经常不...

  • Mysql 配置主主同步

    同步现有数据 开始同步之前,要保证两边的mysql数据和表结构一致,不然同步过程中会出错。同步数据可以使用mysq...

  • django

    django django同步表结构建表修改表数据库操作增删改查 同步表结构 所有操作需要在项目manage.py...

  • mysql数据库同步表结构

    实际工作中,两个mysql数据库本来结构是相同的,但是经过几轮迭代之后,数据结构往往会有比较大的差异,此时落后的数...

  • MySQL进阶:表结构设计

    摘要:MySQL 表结构设计是MySQL架构设计最为基础的工作,优化表结构设计是开发规范,避免后期因为表结构设计不...

  • Mysql学习——MySQL数据结构修改(2)

    Mysql表结构操作添加表字段修改表字段删除表字段修改表字段类型修改表名简介:Mysql表结构操作,添加表字段,修...

网友评论

      本文标题:MySQL对比同步表结构

      本文链接:https://www.haomeiwen.com/subject/vuixwltx.html