【1】下载安装

【1.1】下载

linux:wget https://downloads.mysql.com/archives/get/p/30/file/mysql-utilities-1.6.5.tar.gz

【1.2】二进制编辑安装

#前置条件,python2.6及以上

tar -xvzf mysql-utilities-1.6.5.tar.gz

cd mysql-utilities-1.6.5python ./setup.py build

python ./setup.py install

【1.3】检查是否安装好

mysqlfrm --version

【2】参数介绍与使用

【2.1】参数介绍

--basedir :如 --basedir=/usr/local/percona-5.6.21

--server : 如 --server=user:password@192.168.1.100:3306

--diagnostic : 开启按字节模式来恢复frm结构--user :启动MySQL用户,通过为mysql

【2.2】使用 --basedir 模式

(1)mysqlfrm --basedir=/usr/local/percona-5.6.21/ /root/t1.frm --port=3434 --user=mysql --diagnostic

# WARNING The --port option is not used in the --diagnostic mode.

# WARNING: The--user option is only used forthe default mode.

# 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 forthe columns and the resulting statement may not be syntactically correct.

# Reading .frmfile for /root/t1.frm:

# The .frmfileis a TABLE.

# CREATE TABLE Statement:

CREATE TABLE `root`.`t1` (

`a`int(11) NOT NULL,

`b`int(11) DEFAULT NULL,

`c`int(11) DEFAULT NULL,

`d` varchar(600) DEFAULT NULL,

PRIMARY KEY `PRIMARY` (`a`),

KEY `idx_t1_bc` (`b`,`c`)

) ENGINE=InnoDB;

【2.3】使用--server方式恢复

mysqlfrm --server=user:password@192.168.1.100:3306 /root/t1.frm --port=3434 --user=mysql --diagnostic

WARNING: Using a password on the command line interface can be insecure.

# WARNING The--port option is not used in the --diagnostic mode.

# WARNING: The--user option is only used forthe default mode.

# Source on192.168.1.100: ... connected.

# 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 forthe columns and the resulting statement may not be syntactically correct.

# Reading .frmfile for /root/t1.frm:

# The .frmfileis a TABLE.

# CREATE TABLE Statement:

CREATE TABLE `root`.`t1` (

`a`int(11) NOT NULL,

`b`int(11) DEFAULT NULL,

`c`int(11) DEFAULT NULL,

`d` varchar(200) COLLATE `utf8_general_ci` DEFAULT NULL,

PRIMARY KEY `PRIMARY` (`a`),

KEY `idx_t1_bc` (`b`,`c`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#...done.

mysql linux .frm位置_linux 使用mysqlfrm相关推荐

  1. linux上mysql分区磁盘位置_Linux下Oracle软件、数据文件等所在的磁盘分区空间不足的解决思路...

    虚拟机中的ORACLE运行的久了,归档.数据文件不断增长,原来安装ORACLE的分区空间不足.此时可以重新向虚拟机增加一块硬盘,将OR 虚拟机中的Oracle运行的久了,归档.数据文件不断增长,原来安 ...

  2. mysql linux centos 安装_Linux centos 下在线安装mysql

    1,查看是否有安装过mysql: #rpm -qa | grep mysql 如果无结果返回,说明没有安装Mysql,可以全新安装. 2,查看在线服务器提供的Mysql相关的安装包有哪些: #yum ...

  3. mysql linux 关闭防火墙_linux常用命令和关闭防火墙

    2.        linux常用命令 Mkdir 创建 Rm -rf 删除 Chmod -R 777 权限 Mysql -uroot -r quit退出 find / -name svn 查找位置 ...

  4. linux驱动位置_Linux驱动程序学习一 (续)

    继续linux设备驱动程序第二章的学习实践. 一.当前进程 查找当前进程. 在hello.c中增加以下代码: printk(KERN_EMERG "the process is " ...

  5. mysql linux通用版_Linux下安装通用版本的MySQL

    Start 在MySQL官网上下载安装包,我这里选择的是通用安装包: 在平台(Platform)选择Linux通用版(Linux - Generic),根据自己的系统选择是64位还是32位. 这里列下 ...

  6. mysql linux初始化密码_linux mysql初始化密码

    Linux Mysql安装及初始化方法 /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root ...

  7. linux 安装nginx php mysql 配置文件在哪_linux下 php+nginx+mysql安装配置

    我主要是用来安装php,以及nginx和php的交互. 一 安装插件 可以选择YUM安装或者源码编译安装gccgcc-c++zlib pcre pcre-devel libevent libevent ...

  8. linux安装mysql默认的配置文件_[转]关于Linux安装mysql默认配置文件位置

    在linux下面安装mysql如果在/etc下面没有存在my.cnf配置文件 解决方式如下: 1.通过which mysqld命令来查看mysql的安装位置 2.通过/usr/local/mysql/ ...

  9. linux mysql 文件夹权限_Linux 中文件和文件夹获取 MySQL 权限(SELinux)

    今天在 Linux 系统上移动 MySQL 的数据库目录 配置如下: /etc/my.cnf [mysqld] datadir=/home/mysql socket=/var/lib/mysql/my ...

  10. Linux安装mysql默认配置文件位置

    Linux安装mysql默认配置文件位置 在linux下面安装mysql8.0 如果在/etc下面没有my.cnf配置文件 解决方式如下: 通过which mysqld 命令查看mysql的安装位置 ...

最新文章

  1. debian php mysql 包_Linux+Varnish+Apache+MySQL+PHP一键包For Ubuntu/Debian
  2. Html5 FileReader 对文件进行Base64编码
  3. 关于项目进度慢的思考----如何提高整体开发效率
  4. hashmap时间和空间复杂度_Python算法 00--时间复杂度和空间复杂度
  5. 公司目前实行的git团队协作方案
  6. 【codevs1026】逃跑的拉尔夫,广搜的胜利
  7. Oracle 10g新特性
  8. 各类型土地利用图例_给排水系统各部件及图纸你还有多少不了解?
  9. 蓝牙遥控开关c语言程序,单片机蓝牙控制开关制作(程序源码+安卓APP分享)
  10. java里加载是什么意思_Java 类加载机制详解
  11. Redis:ERR operation not permitted
  12. Linux 如何将eth1网卡修改为eth0
  13. 输入一个十进制数N,将它转换成R进制数输出(运用递归实现)
  14. mysql基础之mariadb库管理和表管理语句
  15. linux服务器备份,Linux服务器上如何备份
  16. 吊炸天——74款APP完整源码
  17. Internet上的Linux资源
  18. “校园知网”5月5日冲刺计划书
  19. 适合arduino小白入门的最基础的函数教程
  20. [Luogu3554] Poi2013 Triumphal arch

热门文章

  1. 一文看懂摄像头测距技术
  2. PAAS平台的理解及与LaaS,SaaS的关系
  3. GPS信号的捕获(PMF+FFT方法)
  4. 华为HCNA实验操作之常用操作命令32-40
  5. UE5 GPU崩溃D3D丢失的终极解决办法
  6. 在线教育凛冬将至!强敌环伺的尚德机构,能否突出重围?
  7. 通俗解释Docker是什么
  8. Java打印年月日历
  9. indesign选中不了图片删除_文件夹删除不了怎么办?文件夹删除不了的解决方法...
  10. algodoo是什么意思_ooc表示的是什么意思什么梗 网络用语OOC含义