Seven, mysql incremental backup and recovery under linux-mysql

1. Back up the meaning of

     Operation and maintenance work: to protect the company's data, site 7 * 24-hour service

     But rather, the data is more important, and the data is the core database data, database backup and recovery is very important. 

Several parameters 2. Backup

   mysql mysqldump is it comes with a backup command.

   Command: mysqldump -u username -p database name> Backup files

  1) Export library inside Oldboy all tables and data structures: the mysqldump -uroot--p'oldboy124 'Oldboy> /dangjingwei/mysql_bak.sql

  2) All imported data and the table structure inside database Oldboy: MySQL -uroot--poldboy124 Oldboy </dangjingwei/mysql_bak.sql

  View the exported mysql_bak.sql file : egrep -v "# | \ *below, there are three points should be noted:

   1. As can be seen, there is drop in the export, then at the time of import, if the library has a corresponding table, this table will be deleted

   2. The table will lock mechanism, lock, at the time of import, is to prohibit other people writing

   3. Here you can see, when imported, is a statement, to reduce the IO output

  

 

 

  

 

  Export added B: mysqldump -uroot -p'oldboy124 '-B oldboy> /dangjingwei/mysql_bak_B.sql

  Import was added B: mysqldump -uroot -p'oldboy124 '</dangjingwei/mysql_bak_B.sql

  Export plus compression: mysqldump -uroot -p'oldboy124 '-B oldboy | gzip> /dangjingwei/mysql_bak_B.sql.gz

Guess you like

Origin www.cnblogs.com/dangjingwei/p/11440111.html