Several solutions to problems in MySQL restoration

  • 2020-12-13 19:08:35
  • OfStack

Here's the thing: I had an BuyVM VPS, and the machine crashed, and they opened a new one for me, and I asked to export a backup copy, and they actually rescued most of the data. There is then a process of recovery.Web recovery is not difficult. The problem lies in the recovery of MySQL. Write one.

1. data directory is complete, but it is impossible to read any 1 table. show tables appears empty.

At first, I suspected there was a problem with the data directory. I tried to fix it, but there was no table. Specify user group as mysql and resolve.


chown -R mysql /var/lib/mysql

2. Then repair, appear


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 prompt, it is data file owner problem,1 it is root, give him mysql and solve it.


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

3. After running the repair, there is a table Error: Incorrect information in file: '. /aaa/ bbb.frm '.

Attempts at various fixes were unsuccessful.Google 1 found.frm stores only table structures. Table structure & # 63; Try 1 to overwrite files with the same table structure. Delete bbb. frm, copy 1 library ccc. frm, renamed bbb. frm. 1 look, done!

In a word, multiple backups are the order of the day, and mysql always has a variety of problems with disk transfers.


Related articles: