Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 09-27-2015, 07:29 AM   #1
Beta Member
matyche's Avatar
Join Date: Sep 2015
Location: Germany
Posts: 1
Thumbs up MySQL slave table crashed, how to fix it?

I have a corrupt MySQL slave table, it says:
table is marked as crashed and last repair failed

Of course, when i ran repair statement, it still showed: Corrupt

My purpose is to quickly restore the slave table. Since master table is good, my question is can i use one of the two options listed below:
1. Drop slave table, stop and start slave again, will replication automatically restore the slave table? (previously the replication was working fine)
2. Drop slave table, use mysqldump to dump the master table to slave table (suppose there is not much traffic at this time).

Thanks for any suggestion.

matyche is offline   Reply With Quote
Old 09-28-2015, 01:55 AM   #2
Site Team
root's Avatar
Join Date: Mar 2004
Posts: 7,872
Default Re: MySQL slave table crashed, how to fix it?

Personally, I'd go with the second option that you've thought of.

obviously you'll want to ensure that replication is still working after you're done.

I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 10-01-2015, 12:43 PM   #3
Beta Member
kadenwalton's Avatar
Join Date: Oct 2015
Location: Sioux Falls
Posts: 1
Thumbs up Re: MySQL slave table crashed, how to fix it?

Repairing a table with REPAIR TABLE or in case it doesn't work apply helpful resources with various methods, ultimate solution will help you only at severe mysql database corruption

https://www.repairtoolbox.com/mysqlrepair.html Repair Toolbox for MySQL

In most cases, a simple REPAIR without any options should work fine. An unusual case is when the .MYI is missing. Here is what would happen:
mysql> REPAIR TABLE fixtures;
| Table | Op | Msg_type | Msg_text |
| sports_results.fixtures | repair | error | Can't find file: 'fixtures.MYI' (errno: 2) |

The repair has failed because the index file is missing or has a corrupted header. To use the definition file to repair, use the USE_FRM option, as follows:
mysql> REPAIR TABLE fixtures USE_FRM;
| Table | Op | Msg_type | Msg_text |
| sports_results.fixtures | repair | warning | Number of rows changed from 0 to 2 |
| sports_results.fixtures | repair | status | OK |
Everything has gone smoothly this time, as indicated by the OK Msg_text.
kadenwalton is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 03:55 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0