Repair MySQL database with mysqlcheck

To check and repair all databases in a database run

mysqlcheck -A --auto-repair -u root -p

Forcefully optimize all tables, automatically fixing table errors that may come up.

mysqlcheck -A --auto-repair -f -o -u root -p

To check all databases

Advertisement

mysqlcheck --all-databases -u root -p -c

To analyze all tables in all databases:

mysqlcheck --all-databases -u root -p -a

To repair all tables in all databases:

mysqlcheck --all-databases -u root -p -r

To optimize all tables in all databases:

mysqlcheck --all-databases -u root -p -o

To check all tables in a database, run

mysqlcheck  --databases DB_NAME_HERE
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement