I notice that when phpMyAdmin opens a DB it shows immediately if a table has crashed or not. It thus seems to me that phpMyAdmin is not running a CHECK TABLE
or ANALYZE TABLE
.
Does anybody know what it does to obtain this informaiton so quickly and efficiently?
Part 2: Running mysqlcheck Command To use the mysqlcheck table command and check tables, follow these steps: Step 1: As an administrator, change your directory to MySQL Data Directory. Step 2: Now type in the mysqlcheck command to check for an existing table in a database.
mysqlcheck is a maintenance tool that allows you to check, repair, analyze and optimize multiple tables from the command line. It is essentially a commandline interface to the CHECK TABLE, REPAIR TABLE, ANALYZE TABLE and OPTIMIZE TABLE commands, and so, unlike myisamchk and aria_chk, requires the server to be running.
show table status where comment like '%crash%';
The most efficient way I have found is to use the commandline mysqlcheck
tool:
mysqlcheck -u mydbuser -p mydbname
This will access mydbname
using user mydbuser
and prompting for that user's password. It will then check each table in the specified database.
See https://dev.mysql.com/doc/refman/5.7/en/mysqlcheck.html
Note: this is not how phpMyAdmin does it, so this is not strictly an answer for the original question, but I'm putting this here because Google sends searches for mysql show crashed tables
here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With