1. Duplicate table structure1.1 Complete table structure with information such as primary keyCREATE table New table name like book;1.2 Only table structure, no primary key and other informationCREATE table new table name select * from books;orCREATE table new table name as (SELECT * from book);orCREATE table new table name select * from books where 1=2;2. Pour data from old tables into new table insert into new table SELECT * from old table; Note: The new table must already exist 3. Enter the DDL statement that created the table the name of the Show create table table; 4. Empty the table data truncate the table name; 5. Backing up a database such as backing up the library database go to the bin directory of MySQL C:\Program files\mysql\mysql Server 5.5\bin> Take advantage of "mysqldump-u username-P database name > Backup Name" Export database to file C:\Program files\mysql\mysql Server 5.5\bin>mysqldump-u root-p Library >library.sqlenter Password: * * * . 6. Restore Database Restore library database as an example, create database library and then enter "source path" under Mysql>.
MySQL table copy and backup restore