Backup: Mysqldump-u user-p pwd-h host Dbname[tbname,[tbname ...] >filename.sql---(logical backup)
-q or -quick ----does not occupy memory-w "Where clause" or -where = where clause ----conditions--all-databases -----All databases--databases ------Multiple databases, separated by spaces between databases--skip-opt -----do not use memory mysqlhotcopy db_name_1,... db_name_n /path/to/new_directory --- Cold backup (physical backup) (not for InnoDB)--------------------hot backup is not applicable with MyISAM restore:mysql -u user -p [dbname]< filename.sql source filename.sql ----Restore cp -r /path/to/new_directory within the database Database Data Catalog (MYSQL/DATA) ----Not applicable with InnoDB (cold restore) mysqldump -h www.abc.com -u root -p dbname |mysql -h www.bcd.com -u root -p ---database migration load data low_ priority infile "Data.sql" into table table_name; --- Insert data from the data file on the original data (server is running) replace ----load data parameter (indicates that the new row is inserted instead of the original duplicate line) ignore ----with replace, (means skipping duplicate rows)
Common backup restore of MySQL notes