Migration of MySQL database file FRM

Source: Internet
Author: User

In actual development today, we will discuss the problem of porting a MySQL database. copy the database files in local data to test on another machine and execute show tables. The database table is displayed, but the error is returned for any operation on the table: The table does not exist, the database file (. FRM) copy-> stick to the data folder where the mysqldb directory is installed locally. this is not what we think. for MySQL database transplantation, we can see that only the table structure generated by the database is as follows. FRM is a file with the suffix.

Actually ,. FRM. MYD. myi is a MySQL data storage file, which represents the structure, data, and index file of the MySQL database table. By default, only the database table structure files are generated when the database and table are created. FRM. when porting a database, there must be three format database table files to use the database normally. When we create a database locally and tables in the database domain, only the character set description file and table structure file of the database exist in the data folder. to port the database, it should be in the database domain, that is, use targetdatabase; then run the following statement to generate data storage files in the other two formats,

Alter table targettablename engine = MyISAM row_format = compact;

After the preceding statements are executed for each table, the other two formats of the database tables under the data file are generated.ArticleThe database table does not exist in the beginning.

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.