Mysql Database Import _ only use frm to import table structure to mysql

Source: Internet
Author: User

A jsp code segment connecting to mysql on the internet, giving the database backup file, but only frm,

Each mysql table has three files ,*. frm describes the table structure ,*. MYD Stores Table data records ,*. MYI is the index of the table,

After checking the information, only frm files can be imported.

 

The process is as follows:

1. In the data directory under the mysql directory, find the name of the database where the table to be imported is located and put the frm file in it. For example, here I am offer. frm and the database name is netshop,

Put it in the database netshop directory, and show tables in mysql displays the following

The table is displayed here, but the following error is prompted when desc offer

 

2. Create the following two files in the same directory as offer. frm. The file content can be blank:
Offer. MYD and offer. MYI

3. Use the MYSQL Data Table recovery command repair on the MYSQL command line to restore the table, as shown below:

According to the results, the recovery command is successfully executed. Run the desc command to test it:

 

Author: jason0539

Weibo: http://weibo.com/2553717707

Blog: http://blog.csdn.net/jason0539 (reprinted please explain the source)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.