This is an old revision of the document!
To rebuild a table by dumping and reloading it, use mysqldump to create a dump file and mysql to reload the file:
mysqldump db_name t1 > dump.sql mysql db_name < dump.sql
To rebuild all the tables in a single database, specify the database name without any following table name:
mysqldump db_name > dump.sql mysql db_name < dump.sql
To rebuild all tables in all databases, use the –all-databases option:
mysqldump –all-databases > dump.sql mysql < dump.sql
Command | Function |
---|---|
mysqldump | - |
mysqlcheck --repair --databases db_name | Repair data types and character sets of a single db changed by updates |
mysqlcheck --repair --all-databases | Repair data types and character sets of all dbs changed by updates |