Techn4b’s Blog

November 30, 2009

MySQL 5 – check and repair database

Filed under: Linux, SQL — Tags: , , , , — techn4b @ 10:55

Shell> mysqlcheck –all-databases -p –auto-repair

Default user root, with given password.

More Information: http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html

Example Output:

mytable
warning  : Table is marked as crashed
error    : Size of datafile is: 593178624         Should be: 593179500
error    : Corrupt

Repairing tables
mytable
info     : Found block that points outside data file at 593176692
status   : OK

Create a free website or blog at WordPress.com.