Posted on 03-08-2013 05:42 PM
It's taking forever to repair the Database Tables, and I'm not certain the process continues after I'm timed out of the web interface. Is it possible to repair the database tables from the command line?
Solved! Go to Solution.
Posted on 03-08-2013 07:36 PM
You can use the mysqlcheck command to perform several operations including check, repair and/or optimize.
example:
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html
Posted on 03-08-2013 07:36 PM
You can use the mysqlcheck command to perform several operations including check, repair and/or optimize.
example:
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html
Posted on 03-11-2013 09:49 AM
Thanks Sonic84!
Posted on 04-11-2016 07:31 PM
How to auto repair all databases with mysqlcheck
$ mysqlcheck -u root --auto-repair --all-databases
--auto-repair If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.
--all-databases Check all the databases. This is the same as --databases with all databases selected.
Posted on 07-24-2016 07:01 AM
Thought I'd post these commands here, in case anyone needs to first do a full backup of MySQL, then check and repair all databases.
First command does a full backup of MySQL, this includes all databases, all GRANTs, etc.
Second command outputs a log so you can peruse table maintenance success, since Command Prompt on Windows doesn't seem to let you scroll up through the whole enchilada output.
mysqldump -u root -p<password> --all-databases > database_backup.sql
mysqlcheck -u root -p<password> --auto-repair --check --all-databases > database_backup.txt
Posted on 08-29-2016 10:36 AM
removed -wrong posting