En ocasiones se te puede presentar el siguiente error en una tabla de una base de datos de MySQL:

Table 'prueba' is marked as crashed and should be repaired

Para repararlo, abre un command prompt de Windows y cámbiate al directorio donde tienes instalado MySQL, y luego al directorio “bin”. Es en este directorio donde están todos los comandos de MySQL.

cd "C:\Program Files\MySQL\bin"

Después ejecuta el comando “myisamchk” sobre la tabla que se dañó:

bin>myisamchk "bdpruebaprueba.myi"
 Checking MyISAM file: bdpruebaprueba.myi
 Data records: 34548 Deleted blocks: 0
 myisamchk: warning: Table is marked as crashed and last repair failed
 myisamchk: warning: 1 client is using or hasn't closed the table properly
 check file-size
 myisamchk: error: Size of datafile is: 8936628 Should be: 8936696
 check record delete-chain
 check key delete-chain
 check index reference
 check data record references index: 1
 check record links
 myisamchk: error: got error: 120 when reading datafile at record: 34548
 MyISAM-table 'bdpruebaprueba.myi' is corrupted
 Fix it using switch "-r" or "-o" 

Como puedes ver, nos está marcando un error, ahora para repararlo utiliza “-r”:

bin>myisamchk "bdpruebaprueba.myi" -r
 recovering (with sort) MyISAM-table 'bdpruebaprueba.myi'
 Data records: 34548
 Fixing index 1
 Found link that points at 8936628 (outside data file) at 8924612
 Found block that points outside data file at 8924740
 Data records: 34576 

Y si corres nuevamente el primer comando, verás como ya no te aparece el error:

bin>myisamchk "bdpruebaprueba.myi"
 Checking MyISAM file: bdpruebaprueba.myi
 Data records: 34576 Deleted blocks: 0
 check file-size
 check record delete-chain
 check key delete-chain
 check index reference
 check data record references index: 1
 check record links 

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *


8 − cuatro =