This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10315|Reply: 0

[Source] Table 'tablename' is marked as crashed and should be repaired

[Copy link]
Posted on 7/8/2019 5:29:26 PM | | | |
Table 'xxxx' is marked as crashed and should be repaired
The main meaning is that the datasheet 'table' is flagged as problematic and needs to be fixed.



What causes the problem?

1. Some of the indexing errors caused by frequent queries and table changes were checked from the Internet.

2. It is also said that the MYSQL database is damaged for some reason, such as: the sudden power outage of the database server, and the operation of the original file of the table when providing services to the database table may cause the MYSQL database table to be damaged and the data cannot be read. In short, it is because of some unmeasurable problems that cause the table to be damaged.


Solution:

Find the bin/myisamchk tool in the mysql installation directory and type it in the command line:

where user. MYI is the name of the table.

The myisamchk tool will then help you restore the index of the data table. Restart mysql and the issue is solved.




The new error is as follows:

C:\Program Files\MySQL\MySQL Server 5.7\bin>myisamchk -c -r D:\MySqlDataNew\itsvse.MYI
- recovering (with sort) MyISAM-table 'D:\MySqlDataNew\itsvse. MYI'
Data records: 47262937
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table 'D:\MySqlDataNew\itsvse. MYI' is not fixed because o
f errors
Try fixing it by using the --safe-recover (-o), the --force (-f) option or by no
t using the --quick (-q) flag

C:\Program Files\MySQL\MySQL Server 5.7\bin>


myisamchk has no myisam_sort_buffer_size, only sort_buffer_size, it is estimated that the sort_buffer_size is insufficient, my index MYI file is large, so simply set –sort_buffer_size=160M. Set other parameters as well, anyway, it doesn't exceed the memory size. Run the following command to set up sort_buffer_size and repair the table:






But going into mysql still doesn't work.

Finally, entering repair table tablename under mysql > successfully fixed the error.





Previous:C# Http request Upload form file (additional parameters can be added)
Next:Share a few measured websites for receiving SMS verification codes online
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com