Several problems solving methods in Mysql recovery _mysql

Source: Internet
Author: User

The thing is this: I have a BUYVM vps, the results of the machine hung, and then opened a new one to me, I asked to export a backup, they really rescued most of the data. Then there is a process of recovery. Web recovery is not difficult. The problem is in the recovery of MySQL, remember a pen.

1. The data directory is complete, but you cannot read any of the tables and show tables is empty.

At first it was suspected that there was a problem with the data directory and tried to fix it without indicating that the table existed. The light always reminds me that it is not a user group issue. Specify user group for MySQL, resolve.

Copy Code code as follows:

Chown-r Mysql/var/lib/mysql

2. Then repair, appear

Copy Code code as follows:

Warning:table is marked as crashed and last repair failed
Warning:1 client is using or hasn ' t closed the table properly
Warning:size of datafile is:32453700 Should be:32376944
Error:wrong bytesec:0-0-0 at linkstart:32453660

According to the prompts, is the data file owner problem, a look is really root, to his MySQL, solve.

Copy Code code as follows:

Chown-r Mysql.mysql/var/lib/mysql

3. After you run the repair, you are prompted to have a table error:incorrect information in file: './aaa/bbb.frm '.

Attempts to repair the various methods have not been successful. Google a bit, and found that. frm stores only the table structure. Let's try a file overlay with the same table structure. Delete the bbb.frm, casually copy a library under the Ccc.frm, renamed Bbb.frm. Look, it's done!

In a word, multiple backup is the king, MySQL disk transfer will always encounter a variety of problems.

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.