• 使用mysqlfrm恢复frm表结构,获得建表语句


    1、mysqlfrm 是一个恢复性质的工具,用来读取.frm文件并从该文件中找到表定义数据生成CREATE语句。

      下载链接:https://downloads.mysql.com/archives/utilities/

      由于mysqlfrm是mysql-utilities工具一部分,我们在Windows里面安装mysql-utilities即可;在安装目录下,会有各种命令;

      

      centos7安装:

        (1) rpm -ivh mysql-connector-python-2.1.7-1.el7.x86_64      #这里用mysql-connector-python-2.1.7

            链接地址:https://downloads.mysql.com/archives/get/file/mysql-connector-python-2.1.7-1.el7.x86_64.rpm

        (2) rpm -ivh mysql-utilities-1.6.5-1.el7.noarch.rpm

            链接地址:https://downloads.mysql.com/archives/get/file/mysql-utilities-1.6.5-1.el7.noarch.rpm

        注意: 尽量不要通过yum来安装mysql-utilities;而且mysql-utilities 1.6.5和mysql-connector-python 8.0.12在一起有问题!

    2、mysqlfrm相关参数介绍

       man mysqlfrn    #用此命令查看具体帮助

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

      --server : 如 --server=user:password@192.168.1.100:3306;user:mysql登录mysql的用户名,password:登录mysql的密码

      --diagnostic : 开启按字节模式来恢复frm结构

      --user :启动MySQL用户,通过为mysql,

      使用--server方式恢复:

      D:MySQLMySQL Utilities 1.6>mysqlfrm --server=root:root@127.0.0.1:3306 d:yiming.weiDesktopgonggao.frm --port=3434 --user=mysql --diagnostic

      注:root:root@127.0.0.1:3306 :第一个root是我的mysql用户名,第二个root是mysql密码;

             d:yiming.weiDesktopgonggao.frm:frm文件的位置;

        --port=3434:这个固定使用3434即可

        --user=mysql --diagnostic:固定使用即可

    3、执行结果

      Windows,这里可能因为编码格式等原因,产生了乱码

      

      centos7,Linux里面一切正常

      

       也可以直接用--diagnostic参数:

         mysqlfrm  --diagnostic /xxx/xxx/xxx.frm
  • 相关阅读:
    【转】ASP.NET MVC 使用 FluentScheduler 定时器计划任务
    【转】prototype扩展的JavaScript常用函数库
    【转】JavaScript系列文章:自动类型转换
    【转】Open Live Writer 插件更新
    highcharts与highstock实例
    SQL SERVER数据类型与C#数据类型对照表
    Highcharts在IE中不能一次性正常显示的一种解决办法
    MIME类型大全
    几种工具反编译被编译好的DLL文件
    MySQL之数据库的操作
  • 原文地址:https://www.cnblogs.com/weiyiming007/p/10280943.html
Copyright © 2020-2023  润新知