前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >MySQL管理工具mysql-utilities-1.6.5

MySQL管理工具mysql-utilities-1.6.5

原创
作者头像
shynodes
修改2021-07-28 10:20:04
1.4K0
修改2021-07-28 10:20:04
举报
文章被收录于专栏:ShyNodesShyNodes

简介

mysql-utilities是mysql的一个工具集合,它是基于----- python2 --- 实现的,从官网查看到最新版本为mysql-utilities-1.6.5.tar.gz

编译安装

代码语言:txt
复制
 wget [https://cdn.mysql.com/archives/mysql-utilities/mysql-utilities-1.6.5.tar.gz](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

工具之一mysqlfrm

mysqlfrm 可以抽取frm文件里面的表结构

mysqlfrm 有两种操作模式。默认的模式是再生个实例,使用--basedir选项或指定--server选项来连接到已经安装的实例。这种过程不会改变原始的.frm文件。

该模式也需要指定--port选项来给再生的实例使用,该端口不能与现有的实例冲突。在读取.frm文件后,再生的实例将被关闭,所有的临时文件将被删除的。

另一个模式是诊断模式,--diagnostic 选项。byte-by-byte读取.frm文件 尽可能多的恢复信息。该模式有更多的局限性,不能校验字符集。

当使用默认模式无法读取文件或者该服务器上没有安装MySQL实例就使用诊断模式。

代码语言:txt
复制
[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;

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 简介
  • 编译安装
  • 工具之一mysqlfrm
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档