Error 1033: incorrect information in file: './qs_52_table/qs_member_table.frm'
The above problem occurs when a MySQL version is different! Table repair is not solved! Later, I searched for information. It seems that the structure version is incompatible!
Method 1: Create a new table (same as the original table) and import the data! You can clear the original backup table and insert new data.
2: overwrite. frm in the original backup table to the new database. Back up data before the operation.
I can. I don't know if it is suitable for your database.
Below are some of the information you are looking:
13.4 use myisamchk for crash recovery
--------------------------------------------------------------------------------
MySQL Translator: Yanzi http://www.mysql.com/doc.html
The file format used by MySQL to store data has been widely tested, but there are always external conditions that can lead to database tables
Damaged:
The mysqld process is killed in a write.
The computer is accidentally shut down (for example, if the computer loses power ).
A hardware error
This chapter describes how to check and process data corruption in the MySQL database. If your table is damaged a lot, you should try to find its
Reason! See G.1 debug a MySQL server.
When performing crash recovery, understand that the three files in the database directory corresponding to each table tbl_name in a database are
Important:
File Usage
"Tbl_name.frm" table definition (table) File
"Tbl_name.myd" Data File
"Tbl_name.myi" index file
Each file type of these three files may be damaged in different forms, but the problem occurs most often in data files and index files.
.
Myisamchk creates a copy of the ". MYD" (data) file in one row.
". MYD file and rename the new file to the original file name to end the repair phase. If you use -- quick or myisamchk
Create a temporary ". MYD" file, just assume that the ". MYD" file is correct and only one new index file is created.
It is safe to touch the ". MYD" file, because myisamchk automatically detects whether the ". MYD" file is corrupt and in this case
. You can also give myisamchk two -- quick options. In this case, myisamchk will not cause some errors
Instead, try to solve them by modifying the ". MYD" file. Generally, only when you have too few idle Disks
To implement a normal repair in the space, use two -- quick options. In this case, you should be at least running
Make a backup before myisamchk.
13.4.1 check table errors
To check a table, run the following command:
Myisamchk tbl_name
This can identify the 99.99% of all errors. What it cannot find is that it only involves corruption of data files (which is not common ). If you want
Check a table. You should run myisamchk or any one with the-S or -- silent options without any options.
Myisamchk-e tbl_name
It performs a completely thorough data check (-E means "extension check "). It performs a read check on each row for each key to confirm that they
It does point to the correct row. This can take a long time on a large table with many keys. Myisamchk usually finds the first
Error. If you want more information, you can add the -- verbose (-v) option. This causes myisamchk to follow
Up to 20 errors are allowed. In general use, a simple myisamchk (without parameters other than the table name) is enough.
.
Myisamchk-e-I tbl_name
Like the previous command, the-I option tells myisamchk to print some statistics.
13.4.2 how to repair a table
The symptoms of a damaged table are usually query unexpected interruptions and you can see such errors:
"Tbl_name.frm" is locked and cannot be changed.
The file "tbl_name.myi" (errcode: ###) cannot be found :###).
Error ### obtained from the table processor (error 135 is an exception ).
Unexpected File termination.
The record file is destroyed.
In these cases, you must repair the table. Myisamchk can usually detect and fix most of the errors.
The repair process consists of up to four phases, which are described below. Before you start, you should CD the permission to the database directory and checklist file.
Limits, make sure they can be read by Unix users running mysqld (and you, because you need to access the files you are checking ). If it
If you refuse to modify files, they must be writable by you.
Phase 1: Check your table
Run myisamchk *. myi or (myisamchk-E *. myi if you have more time ). Disable the-s (SILENCE) Option
Necessary information.
You must fix only tables whose myisamchk reports have an error. For such a table, continue to Stage 2.
If you get a strange error (for example, out of memory error) during the check, or if myisamchk crashes, to stage 3.
Stage 2: simple and secure Restoration
First, try myisamchk-r-Q tbl_name (-r-Q means "quick recovery mode "). This will try not to touch the data file
To repair the index file. If the data file contains everything it should have and the deletion link pointing to the correct location in the data file, this should
It works and the table can be repaired. Start repairing the next table. Otherwise, use the following procedure:
Back up a data file before continuing.
Use myisamchk-r tbl_name (-R means "recovery mode "). This will delete the incorrect records and
The deleted record and re-create the index file.
If the previous step fails, use myisamchk -- safe-Recover tbl_name. The security recovery mode uses an old recovery
Redo the method to handle a few cases (but slower) where the conventional recovery mode does not work ).
If you get a strange error (for example, an out of memory error) during the fix, or if myisamchk crashes, to stage 3.
Stage 3: difficult repairs
If the first 16 K block in the index file is damaged, or contains incorrect information, or if the index file is lost, you only need
This stage. In this case, it is necessary to create a new index file. Follow these steps:
Move data files to a safer place.
Use the table description file to create new (null) data and index files:
Shell> MySQL db_name
Mysql> Delete from tbl_name;
Mysql> quit
Copy the old data file to the newly created data file. (Do not just move the old file back to the new file; you must keep one
Copies to prevent some errors .)
Return to Stage 2. Now myisamchk-r-Q should work. (This should not be an infinite loop ).
Phase 4: very difficult repairs
Only when the description file is damaged should you reach this stage. This should never happen, because after the table is created
The file is no longer changed.
Recover the description file from a backup and return to phase 3. You can also restore the index file and return to Stage 2. For the latter, you should
Start with myisamchk-R.
If you do not have a backup, but know exactly how the table is created, create a copy of the table in another database. Delete
In addition to the new data files, the description and index files are moved from other databases to the damaged database. This gives you a new description and
Index file, but leave the data file alone. Go back to Stage 2 and try to recreate the index file.
13.4.3 table Optimization
To combine the sharded records and eliminate the space wasted by deleting or updating the records, run myisamchk in recovery mode:
Shell> myisamchk-r tbl_name
You can optimize a table in the same way as the SQL optimize TABLE statement. Optimize table is easier,
Myisamchk is faster. There is no unnecessary interaction possibility between a utility and the server, because when you use
When optimize table, the server does all the work.
Myisamchk also has many other options you can use to improve the performance of a table:
-S, -- Sort-Index
-R index_num, -- Sort-records = index_num
-A, -- Analyze
For a complete description of the options, see 13.1.1 myisamchk call syntax.
**************************************** **********
/// Hand-in-hand migration problem:
**************************************** ***********
Mysql> select * From qs_member_table limit 2;
Error 1033: incorrect information in file: './qs_52_table/qs_member_table.frm'
Mysql> select * From qs_member_table limit 2;
Error 1105: File '/usr/local/MySQL/var/qs_52_table/qs_member_table.myd' not found
(Errcode: 13)
Mysql> select * From qs_member_table limit 2;
Error 1105: File '/usr/local/MySQL/var/qs_52_table/qs_member_table.myd' not found
(Errcode: 13)
Mysql> exit
Bye
[Root @ ccnpic root] # chown-r MYSQL: MySQL
/Usr/local/MySQL/var/qs_52_table/qs_member_table.myd;
[Root @ ccnpic root] # chown-r MYSQL: MySQL
/Usr/local/MySQL/var/qs_52_table/qs_member_table.myd;
[Root @ ccnpic root] # mysql-u root-P
New qs_member_table.frm table structure Overwrite
It may be because the table structure is incompatible!
,,,,,,,,,,,,,,,,
Error 2013: Lost connection to MySQL server during Query
''''''''''''''''''''''''''''
Error 2006: MySQL server has gone away
No connection. Trying to reconnect...
Connection ID: 25
Current Database: qianshou1
When using MySQL for database restoration, the following error occurs due to the large data volume: the MySQL server
Returned this error: MySQL error nr.2006-MySQL server has gone away. One of my MB backups
This error occurs during restoration. The solution is to find the MySQL installation directory and find the my. ini file.
Add: max_allowed_packet = 10 m (you can also set the desired size ). Max_allowed_packet Parameter
Is used to control the maximum length of its communication buffer.