Data files in MySQL (. FRM,. MYD,. MYI) revert to data

Source: Internet
Author: User

Remember the MySQL data file operation experience want to get the latest information of a project, do function upgrade use, back up a copy of data also as local test data, file a bit large, I directly through the remote phpMyAdmin program export, not happy to play, Directly contacted IDC colleague to help guide a copy of SQL file out, the result that the buddy did not throw directly to my data file, which let me how to be good, this problem I have not met Ah. In the face of the problem, but also embarrassed to let him re-send me a copy of SQL file, had to bite the bullet to try how to restore data. Environmental statementThe following actions are for actions under WindowsData file Analysis *.frm is a description of the structure of the table, *. MyD saves the data record of the table, *. Myi is the index of the table MySQL data engine with character view command (recall operation) 1. View the database encoding:
Show variables like ' character% ';
2. View the engine and default database engine code supported by the database:
Show engines;
3. View the default engine for the current database:
Show variables like '%storage_engine% ';
4. How to modify the Database engine:
Locate the configuration file for the database My.ini, look for "default-storage-engine", this designation is my current default database engine (default-storage-engine= INNODB) How to recover the data file for the My.ini file, find "DataDir", follow the path open, here is the name of all your local database now, find the library name you want to recover data, if you do not need to create a database, and then click the corresponding folder, Copy the previous data file in. Restart the MySQL service and check to see if there are any data in the database?
(Updated on 2014/10/18) The above method is not suitable for INNODB,INNODB can try to use the innodb_force_recovery to operate, the test was successful once, the latter did not succeed, the specific reason is not clear! reproduced in:Http://www.cnblogs.com/unofficial/p/4030752.html

Data files in MySQL (. FRM,. MYD,. MYI) revert to data

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.