1

I know previously several question had been posted on this topic. But mine is a bit difference. I already tried all the previous solution. What happened is whenever I try to select data from a specific table mysql crashes. I do work fine on all other tables but whenever I select data from that specific table it crashes even from command line. Now I am unable to mysqldump the database and also cant drop the table as it contains valuable data. Please suggest some options.

4
  • 1
    It sounds like the table is corrupted. Have you tried using repair table? Commented Aug 19, 2014 at 8:51
  • what is your storage engine? Commented Aug 19, 2014 at 8:58
  • I just tried. But it says that it can only be used on MyISAM while I am using InnoDB. When I searched for repair in InnoDB it says that I have to use mysqldump and import using mysql. When I tried this it shows error Couldn't find table. Commented Aug 19, 2014 at 9:20
  • If it helps I can send you the Data folder for analysis. Commented Aug 19, 2014 at 13:07

2 Answers 2

1

Use mysqlcheck to check specific table in db.

mysqlcheck -c db_name tbl_name -u root -p

provide password and it will tell you whether your table is corrupted or not.

Then you can use following command to repair table

mysqlcheck -r db_name tbl_name -u root -p 

mysqlcheck work with MyISAM and archive tables.

Sign up to request clarification or add additional context in comments.

5 Comments

Tried: Got error: 2013: Lost connection to MySQL server during query when executing 'CHECK TABLE ...'
What operating system you using?
I tried Windows 7/ XP and also got the same problem over Linux.
I also tried CHECK TABLE with option FAST QUICK it says mysql server has gone away.
I used the trial version of StellarPhoenixDatabaseRepairforMySQL it shows all my data. However approximately 200 rows seems to be corrupted in the table. They are in middle of the table. Say some thousand rows at top then 200 corrupted rows and then again some thousand rows.
0

After several attempts and various suggestions from you guys I finally find a somewhat solution. It is true that the specific table was corrupted. And all other above mentioned options failed. So, I executed a query with limiting my results to 0, 100 and it works fine. Then I dump that data by using that query with mysqldump. I keep on going and changed the limit from 100, 200 and so on. Whenever I get error I simply skipped few rows. At last I had recovered almot 95% of my data which is not bad. Thanks guys for all your support.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.