mysql 大数据量备份方式
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 大数据量备份方式相关的知识,希望对你有一定的参考价值。
mysql 大数据量备份,能实现增量备份。数据量几个G大,最好以2进制的方式备份。
不要mysqldump方式,因为恢复的时候比较慢。
回答好的再加100分。谢谢!
我想要windows的备份方法
1 .一般用mysqldump
2. 增量的可以直接用tar 命令备份
3.对于你这个问题.最好配置个mysql主从..一台坏了.另一台可以工作.就可以不需要经常备份了.
参考技术A
使用into outfile 和 load data infile导入导出备份数据
1、读出写入文件:
select*from mytable wherestatus!=0and name!=''intooutfile'/home/db_bak2012'fieldsterminated by'|'enclosed by'"'linesterminated by'\r\n';
2、导入
loaddatainfile'/home/db_bak2012'intotable mytable_bak fieldsterminated by'|'enclosed by'"'linesterminated by'\r\n';
load data的方式,我试过,10万的数据也就1秒左右。
觉得如果是长期需要备份的,可以用程序来控制或者直接用job来定期执行存储过程。
参考技术B
亲,百度一下吧,有很多类似的
http://www.51cto.com/html/2005/1018/8400.htm
mysql备份策略之我理解
备份策略,我个人感觉应该做到以下几点:
1、 备份的定位:是故障恢复用还是数据归档用;
2、 备份数据量:数据量有多少,需要的空间,备份时间,采用的备份方式;
3、 备份存储:规模化之后是要放在备份存储上的,一般不放在slave机器上,备份文件是放二到三份的;
4. 备份的有效性校验:是非常非常重要的思想。多个备份要抽样恢复;
5. 备份的恢复形式:
6、备份的安全保护:备份监控,备份完是否成功传到存储服务器上;
7、是否可用延迟库来防止主库误删除,而延迟时间又需要设置成多少?
!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tJZCI6Ijc1NjEtMTUzNjA1MjMyMzc3MCIsImJsb2NrVHlwZSI6InBhcmFncmFwaCIsInN0eWxlcyI6eyJhbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsInBhZGRpbmciOiIifSwidHlwZSI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hbGlnbiI6ImxlZnQiLCJpbmRlbnQiOjAsInRleHQtaW5kZW50IjowLCJsaW5lLWhlaWdodCI6MS43NSwiYmFjay1jb2xvciI6IiIsInBhZGRpbmciOiIifSwidHlwZSI6InBhcmFncmFwaCIsInJpY2hUZXh0Ijp7ImRhdGEiOlt7ImNoYXIiOiLkuIAifSx7ImNoYXIiOiLoiKwifSx7ImNoYXIiOiLpg70ifSx7ImNoYXIiOiLmmK8ifSx7ImNoYXIiOiLnlKgifSx7ImNoYXIiOiJ4In0seyJjaGFyIjoidCJ9LHsiY2hhciI6InIifSx7ImNoYXIiOiJhIn0seyJjaGFyIjoiYiJ9LHsiY2hhciI6ImEifSx7ImNoYXIiOiJjIn0seyJjaGFyIjoiayJ9LHsiY2hhciI6InUifSx7ImNoYXIiOiJwIn0seyJjaGFyIjoi5L2cIn0seyJjaGFyIjoi5aSHIn0seyJjaGFyIjoi5Lu9In0seyJjaGFyIjoi55qEIn0seyJjaGFyIjoi77yMIn1dLCJpc1JpY2hUZXh0Ijp0cnVlLCJrZWVwTGluZUJyZWFrIjp0cnVlfX0seyJibG9ja0lkIjoiODA0OS0xNTM2MDUyMzIzNzcxIiwiYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1LCJiYWNrLWNvbG9yIjoiIiwicGFkZGluZyI6IiJ9LCJ0eXBlIjoicGFyYWdyYXBoIiwicmljaFRleHQiOnsiZGF0YSI6W3siY2hhciI6IjEifSx7ImNoYXIiOiIwIn0seyJjaGFyIjoiMCJ9LHsiY2hhciI6IuS4qiJ9LHsiY2hhciI6IuWkhyJ9LHsiY2hhciI6IuS7vSJ9XSwiaXNSaWNoVGV4dCI6dHJ1ZSwia2VlcExpbmVCcmVhayI6dHJ1ZX19XQ==-->以上是关于mysql 大数据量备份方式的主要内容,如果未能解决你的问题,请参考以下文章
ClickHouse 大数据量的迁移方式
MySQL大数据量分页查询方法及其优化
数据库备份主要包括哪三种方式
MySQL备份与恢复之Xtrabackup工具
MySQL百万级数据量分页查询方法及其优化建议
mysql大数据量联表查询