zoukankan      html  css  js  c++  java
  • mysql的一个工具 mysql-utilities

    mysql-utilities是mysql的一个工具集合,它是基于----- python2 --- 实现的,从官网查看到最新版本为mysql-utilities-1.6.5.tar.gz
    编译安装
        wget https://cdn.mysql.com/archives/mysql-utilities/mysql-utilities-1.6.5.tar.gz
        tar xvf mysql-utilities-1.6.5.tar.gz
       cd mysql-utilities-1.6.5
       python setup.py build
       python setup.py install
       mysqldiff --version

    1 mysqlfrm 可以抽取frm文件里面的表结构
    mysqlfrm 有两种操作模式。默认的模式是再生个实例,使用--basedir选项或指定--server选项来连接到已经安装的实例。这种过程不会改变原始的.frm文件。
    该模式也需要指定--port选项来给再生的实例使用,该端口不能与现有的实例冲突。在读取.frm文件后,再生的实例将被关闭,所有的临时文件将被删除的。 另一个模式是诊断模式,--diagnostic 选项。byte-by-byte读取.frm文件 尽可能多的恢复信息。该模式有更多的局限性,不能校验字符集。 当使用默认模式无法读取文件或者该服务器上没有安装MySQL实例就使用诊断模式。
    #
    /tmp/backup/2019-08-27_17-32-55/dstdata 是通过innodbbackupex备份的目录,first是其中的一个表

    [root@localhost mysql-utilities-1.6.5]# mysqlfrm --diagnostic /tmp/backup/2019-08-27_17-32-55/dstdata/first.frm
     # WARNING: Cannot generate character set or collation names without the --server option. # CAUTION: The diagnostic mode is a best-effort parse of the .frm file. 
    As such, it may not identify all of the components of the table correctly.
    This is especially true for damaged files. It will also not read the default values for the columns and the resulting statement may not be syntactically correct.
    # Reading .frm file for /tmp/backup/2019-08-27_17-32-55/dstdata/first.frm: # The .frm file is a TABLE. # CREATE TABLE Statement: CREATE TABLE `dstdata`.`first` ( `id` int(11) DEFAULT NULL, `name` char(16) DEFAULT NULL ) ENGINE=InnoDB; #...done.


  • 相关阅读:
    Android中View绘制流程以及invalidate()等相关方法分析
    开机黑屏 仅仅显示鼠标 电脑黑屏 仅仅有鼠标 移动 [已成功解决]
    servlet上传文件报错(一)
    白话经典算法系列之六 高速排序 高速搞定
    POJ1177+线段树+扫描线
    tensorflow compile
    算法编程题的心得体会
    算法编程题的心得体会
    标识变量的使用
    标识变量的使用
  • 原文地址:https://www.cnblogs.com/mmyy-blog/p/11431289.html
Copyright © 2011-2022 走看看