tags:

views:

11

answers:

0

A server has multiple mysql databases with identical schemas. There is a single table within each database that tends to crash and require repairing. We would like to run something like below on a cron.

mysqlrepair --auto-repair --all-databases --force --silent

  1. For a single table (not large in size) in ~100 databases,
  2. Reading http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html, it states that the tables being processed are locked from other processes. So, am I correct that this should only be something that runs late at night?
  3. The command above is missing the option to specify a single table. How can I add this and not have it override the --all-databases flag? The --tables flag states it

    Overrides the `--databases` or `-B` option.
    

And a related question, short of modifying our application code, is there a better way to be checking/repairing our mysql tables?