Archive for the ‘MySQL’ Category

Mysql fix crashed tables

Sometimes, system halt or power off will make your MySQL database crashed and you without knowing it unless you try to access those bad tables.

Run this Linux command to automatically find crashed tables and fix them.

1
mysqlcheck --auto-repair -A -u <username> -p<password>
  • Share/Save/Bookmark

Make a copy of mysql table

One SQL to make a copy of existing MySQL table ( table structure and records )

1
CREATE TABLE clone_table SELECT * FROM original_table WHERE 1
  • Share/Save/Bookmark