Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL said: #1194 - Table 'tablename' is marked as crashed and should be repaired

If tables are crashing it means something is wrong with my system.

MySQL said: 

#1194 - Table 'tablename' is marked as crashed and should be repaired 

My website is currently down because of this.

I know how to repair table from phpmyadmin but is it safe way to repair?

What is the important factor for this issue?

Question. Generally, Why table get crashed?

Answers. These may be the reasons -

  1. Server's disk space was full. (Please check disk space in live server)

  2. Incorrect shutdown MySQL server/Improperly closing the tables while using the databases.

  3. More server load.

like image 816
Javascript Coder Avatar asked Jun 04 '13 10:06

Javascript Coder


People also ask

What is MySQL error?

Lost connection to MySQL server If an error message like “Lost connection to MySQL server” appears while querying the database, it is certain that the error has occurred because of network connection issues.

Why is my localhost phpMyAdmin not working?

“We are almost done to fix localhost/phpmyadmin” Step 6: Again go to config and select “Apache (httpd-sss. conf)“. Step 8: Find “” and replace this with “” and again save it. Step 9: Go to config and select “service & ports settings” and change the port to 8080 and 4433 and save it.


2 Answers

First of all - there are many reasons for a crashed table.

  • harddisk failure
  • sudden server reboot
  • server crash
  • firmware problems (raid controller or bios)
  • defects in the cabling
  • etc.

A repair with phpmyadmin does basically the same as the mysqlrepair commandline. I would suggest to repair everything on command line:

mysqlrepair -A --auto-repair
mysqlrepair -A -o

Or start a test:

mysqlrepair -A -c
like image 190
Andreas Rehm Avatar answered Oct 29 '22 05:10

Andreas Rehm


If you don't have commandline tools needed, and reason for crash is most likely is MYSQL itself, run this from MYSQL to repair a table:

REPAIR TABLE db_name.table_name;
like image 40
Dmitry Verhoturov Avatar answered Oct 29 '22 05:10

Dmitry Verhoturov