Mysql如何读.frm结尾的表结构定义文件

mysqlfrm工具读 .frm结尾的表结构定义文件
到网站下载rpm包
http://rpm.pbone.net/
上传到mysql服务器上
[root@test ~]# rpm -ivh mysql-utilities-1.6.5-1.el6.noarch.rpm 
warning: mysql-utilities-1.6.5-1.el6.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
        mysql-connector-python >= 2.0.0 is needed by mysql-utilities-1.6.5-1.el6.noarch

发现有依赖关系。
再下载 mysql-connector-python
[root@test ~]# rpm -ivh mysql-connector-python-2.1.7-1.el6.x86_64.rpm 
warning: mysql-connector-python-2.1.7-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-connector-python ########################################### [100%]
[root@test ~]# rpm -ivh mysql-utilities-1.6.5-1.el6.noarch.rpm 
warning: mysql-utilities-1.6.5-1.el6.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-utilities        ########################################### [100%]
安装成功。

[root@test ~]# mysqlfrm /data/mysql/pou_prepub/temp_point_up.frm
Usage: mysqlfrm --server=[user[:]@host[:][:]|[:][:]] [path\tbl1.frm|db:tbl.frm]


mysqlfrm: error: The --port option is required for reading .frm files in the default mode.
[root@test ~]# mysqlfrm --diagnostic /data/mysql/pou_prepub/temp_point_up.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 /data/mysql/pou_prepub/temp_point_up.frm:
# The .frm file is a TABLE.
# CREATE TABLE Statement:


CREATE TABLE `pou_prepub`.`temp_point_up` (
  `sum(point)` decimal(41,0) DEFAULT NULL, 
  `member_id` bigint(20) NOT NULL comment '会员ID' 
) ENGINE=InnoDB;


#...done.

读出了.frm的信息。


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22996654/viewspace-2146995/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22996654/viewspace-2146995/

你可能感兴趣的:(Mysql如何读.frm结尾的表结构定义文件)