How to solve MySQL recovery problems _ MySQL

Source: Internet
Author: User
This article mainly introduces several issues in MySQL recovery. For more information, see the following: I have a BuyVM VPS, then I opened a new one for me and asked me to export the backup. most of the data was actually saved. then there is a recovery process. web restoration is not difficult. the problem lies in the restoration of MySQL.

1. The data directory is complete, but no table can be read. show tables is blank.

First, I suspected that there was a problem with the data directory and tried to fix the problem. the system prompts that there is no table. the system prompts me if there is a problem with the user group. specify the user group as mysql to solve the problem.


The code is as follows:

chown -R mysql /var/lib/mysql

2. fix the problem.


The code is as follows:

warning : Table is marked as crashed and last repair failedwarning : 1 client is using or hasn't closed the table properlywarning : Size of datafile is: 32453700 Should be: 32376944error : Wrong bytesec: 0-0-0 at linkstart: 32453660

According to the prompt, it is the data file owner problem. it turns out that it is root. Give it mysql and solve it.


The code is as follows:

chown -R mysql.mysql /var/lib/mysql

3. after the repair is completed, a table Error is prompted: Incorrect information in file: './aaa/bbb. frm '.

Failed to try various repair methods. Google found that. frm only stores the table structure. table structure? Try overwriting the file with the same table structure. delete bbb. frm, copy the ccc. frm in a database, and change it to bbb. frm!

In a word, multiple backups are king, and mysql always encounters various problems in disk transfer.

The above is the solution to several problems in MySQL recovery _ MySQL content. For more information, please follow the PHP Chinese network (www.php1.cn )!

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.