Solutions to several problems in MySQL recovery, mysql issues

Source: Internet
Author: User

Solutions to several problems in MySQL recovery, mysql issues

This is the case: I have a vps of the BuyVM. As a result, my machine crashes and a new one is opened for me. I asked to export the backup to me. Most of the data is 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.

Copy codeThe Code is as follows:
Chown-R mysql/var/lib/mysql

2. fix the problem.

Copy codeThe Code is 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 shoshould be: 32376944
Error: 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.

Copy codeThe 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.

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.