Wiki GeRgOsNet Notes d’administration système, réseau et domotique

Vous consultez une ancienne version, enregistrée le 20 septembre 2019 par GreG. Voir la version actuelle.

Mysql reparer erreur table

Migration depuis l’ancien wiki MediaWiki

  • On stoppe mysql :
/etc/init.d/mysql stop
  • On regarde si il y a bien des erreurs dans notre table :
myisamchk /var/lib/mysql/ma_base/ma_table.MYI

Cela devrait nous retourner :

Data records:    4945   Deleted blocks:       0

myisamchk: warning: Table is marked as crashed and last repair failed

  • check file-size
myisamchk: warning: Size of indexfile is: 602112        Should be: 53248
  • check record delete-chain
  • check key delete-chain
  • check index reference
  • check data record references index: 1 myisamchk: error: Found 4943 keys of 4945
  • check record links
myisamchk: error: Record-count is not ok; is 4943         Should be: 4945
myisamchk: warning: Found 1870736 deleted space.   Should be 0
myisamchk: warning: Found        971 deleted blocks       Should be: 0
myisamchk: warning: Found       9665 key parts. Should be: 4943

MyISAM-table '/var/lib/mysql/ma_base/ma_table.MYI' is corrupted Fix it using switch "-r" or "-o"

  • On corrige :
myisamchk -r /var/lib/mysql/ma_base/ma_table.MYI
  • On verifie :
myisamchk /var/lib/mysql/ma_base/ma_table.MYI
  • On relance mysql :
/etc/init.d/mysql start