What is the meaning of a library backup?
Sometimes a company's database has multiple libraries, for example (WWW,BBS,CMS), but the problem may be a certain library, if the backup time to back up all the library as a data file, the recovery of data is more troublesome.
Library Backup Method One:
[Email protected] ~]# mysql-uroot-p123456-e "Show Databases" | Grep-evi "database|infor|perfor" |sed-r ' s#^ ([a-z].*$) #mysqldump-uroot-p123456--events-b \1|gzip>/root/back/\1. Sql.gz#g ' |bash
The method of library backup two:
This script simply provides backup ideas and needs to be perfected
[email protected] ~]# cat fenku.sh for dbname in ' mysql-uroot-p ' 123456 '-e ' show databases ' | Grep-evi "Database|infor|perfor" ' Do mysqldump-uroot-p ' 123456 '--events-b $dbname |gzip >/root/back/${dbname}.sql D One
A better backup can refer to video: http://edu.51cto.com/course/course_id-808.html
Sub-database sub-scale disadvantages: Many files, broken
1, backup a complete full, and then do a backup of the Sub-database table
2, Script batch service multiple SQL files
3, the amount of data is too large inappropriate method
This article is from the "Crazy_sir" blog, make sure to keep this source http://douya.blog.51cto.com/6173221/1788002
MySQL Sub-Library backup method