mysql导入数据库_只用frm向mysql导入表结构_MySQL
Jun 01, 2016 pm 01:08 PM网上一个连接mysql的jsp代码段,给了数据库的备份文件,但是只有frm,
mysql的每张表有三个文件,分别是,*.frm是描述了表的结构,*.MYD保存了表的数据记录,*.MYI则是表的索引,
查了下资料,原来只有frm文件也能导入。
过程如下:
1.在mysql目录下的data目录中,找到要导入表所在的数据库的名称,把frm文件放进去,比如我这里是offer.frm,数据库名称是netshop,
放到数据库netshop目录下之后,在mysql中show tables显示如下
在这里table是显示的,但是desc offer就会提示下面错误
2,在与offer.frm同一目录建立以下2个文件,文件内容可以为空:
offer.MYD和offer.MYI
3. 在MYSQL命令行使用MYSQL本身的数据表恢复命令repair命令恢复表,如下:
根据结果可以知道,恢复命令执行成功,下边用desc命令测试下:
作者:jason0539
微博:http://weibo.com/2553717707
博客:http://blog.csdn.net/jason0539(转载请说明出处)

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Reduce the use of MySQL memory in Docker

How do you alter a table in MySQL using the ALTER TABLE statement?

How to solve the problem of mysql cannot open shared library

What is SQLite? Comprehensive overview

Run MySQl in Linux (with/without podman container with phpmyadmin)

Running multiple MySQL versions on MacOS: A step-by-step guide

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?
