How to Recover a Crashed Mysql Database

crash

Among the operation of Ambari, we may confront some annoying failure, such as a crashed MySQL database. So, we can run commands below to recover this kind of problem.

  1. Check the status of the crashed table.

    1
    check table [table name]
  2. Repair crashed table.

    1
    repaire table [table name]

On the other hand, you can use commands below to repair whole crashed tables.

1
mysqlcheck -uroot -p --repair --all-databases
1
myisamchk --recover *.MYI