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.