MySQL Data Sheet repair and data recovery

Source: Internet
Author: User

1. When are MySQL data sheets susceptible to damage? A sudden power outage in the server caused data file corruption. force shutdown, without first shutting down the MySQL service and so on.  2. What is the main phenomenon after the data sheet is damaged? when you select data from a table, you get the following error: Incorrect key file for table: ' ... '. Try to repair ita query cannot find rows in a table or return incomplete data. error:table ' P ' is marked as crashed and should be repaired. failed to open table: Can ' t open file: ' xxx. MYI ' (errno:145).  3. What are the ways to repair a damaged data table? use Myisamchk to fix the steps:1) Stop the MySQL service before repairing. 2) Open the command line and go to the MySQL/bin directory. 3) Execute the path of the Myisamchk–recover database/*. MYI Use the REPAIR table or OPTIMIZE table command to fix the REPAIR table ' table_name ' fix table OPTIMIZE tables ' table_name ' optimization tables REPAIR The table that was destroyed. OPTIMIZE table is used to reclaim unused database space, and when the data rows on the table are deleted, the disk space occupied is not immediately reclaimed, the space is reclaimed after the OPTIMIZE Table command is used, and the data rows on the disk are re-ordered (note: on disk, Rather than a database)

MySQL Data Sheet repair and data recovery

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.