`
linvar
  • 浏览: 254517 次
  • 性别: Icon_minigender_1
  • 来自: 未定
社区版块
存档分类
最新评论

Mysql Backup and Recovery

阅读更多

1.Backup and Recovery Types
   1).logical backup versus physical backups
   2).online backup versus offline backups
   3).local versus remote backups
   4).Full Versus Incremental Backups
      Incremental backups are made possible by enabling the server's binary log, which the server uses to record data changes.
   5).Full Versus Point-in-Time (Incremental) Recovery
      Point-in-Time Recovery need binary log
   6).Backup Scheduling, Compression, and Encryption

2.Backup examples:
   a).make a full backup with mysqldump
   mysql> mysqldump --single-transation --flush-logs --master-data=2 \
   mysql>  --all-databases > backup.sql
   the --flush-logs option causes the server to flush its logs. The --master-data option causes mysqldump to write binary log information to its output(MASTER_LOG_FILE and MASTER_LOG_POS)
   b).we can create an incremental backup by flushing the logs to begin a new binary log file.
   #mysqladmin flush-logs
   #copy the binary log to safe place
   c).using backups for recovery
   #mysql < backup.sql
   process incremental backup binlog
   #mysqlbinlog _binlogfiles_ | mysql
   process some other binlog from the server binlogfiles

3.mysqldump tips
   a).#mysqldump -uroot -p --default-character-set=utf8 -c -e
    db_name tbl1 tbl2 > backup.sql
    [tbl1,tbl2可选,没有表名则备份整个数据库]
    -c Use complete insert statements
    -e Use multiple-row INSERT syntax that include several VALUES lists
   ps: 其他可能有用的参数
   --ingore-table=db_name.tbl3 (如果要ignore两个以上的表,需要再写这个参数选项)
   --insert-ignore
  
   b).导入sql文件到数据库
  一般sql文件编码是utf8.
  导入sql文件到数据库有两种方法,不过linux下只能使用:
  mysql -uroot -p db_name < backup.sql这种方式
  还有一种是进入mysql>命令行时使用source 命令
  这里应该注意使用set names utf8命令,不然sql文件里的中文会出现乱码.
  可以考虑将这条命令加在sql文件之前.
  


分享到:
评论

相关推荐

    High Performance MySQL_3rd_edition

    英文原版,数字版,非影印版,无水印,有目录,第三版。 How can you bring out MySQL’s full power? With High ... Explore backup and recovery strategies—including new tools for hot online backups

    MySQL 8 Cookbook epub 格式

    The book also contains recipes on efficient MySQL administration, with tips on effective user management, data recovery, security, database monitoring, performance tuning, troubleshooting, and more. ...

    mysql8学习手册

    What You Will Learn Install and configure your MySQL 8 instance without any hassle Get to grips with new features of MySQL 8 like CTE, Window functions and many more Perform backup tasks, recover ...

    MYSQL8手册

    MYSQL8手册 1、General informatio 2、installing and upgrading mysql 3、tutorial 4、mysql programs 5、mysql adminstration ...7、backup and recovery 8、optimization 9、language 。。。。

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

    POS or Restaurant(4)

    4. Cooperate with encryption algorithm, permission assignment, detailed system log, backup and recovery functions, So that the safety of the catering system is strongly guaranteed to make the data ...

    POS of Restaurant(5)

    4. Cooperate with encryption algorithm, permission assignment, detailed system log, backup and recovery functions, So that the safety of the catering system is strongly guaranteed to make the data ...

    Learn.PHP.7.148421729

    What are the various backup and recovery techniques How to use Try/Catch blocks as emphasized with PHP 7 to handle program exceptions Audience This book is for those who are new to PHP and new to the...

    Veeam相关软件操作指南,安装配置手册集合包

    1.Veeam Agent for Linux(MySQL) 操作指南 2.Veeam for Instant VM Recovery操作指南 3.Veeam for PostgreSQL 操作指南 4.Veeam for Repliaction操作指南 5.Veeam for SQLServer备份和恢复操作指南 6.Veeam for ...

    backup-restore:创建包括AWS RDS的数据库备份并将其还原到任何计算机

    自动化脚本可从AWS RDS的任何数据库中进行定期备份。 提供了RDS DB的端点。 将任何其他数据库还原到另一个数据库。 管理备份数。 该脚本仅保留7天的备份... 1)热的increnatal备份,而不只是MYSQL DUMP 2)cron的集成。

    RedGate 2013多产品 注册机

    10.Red-Gate SQL Backup 7 11.Red-Gate SQL Compare 10 12.Red-Gate SQL Data Compare 10 13.Red-Gate SQL Data Generator 2 14.Red-Gate SQL Dependency Tracker 2 15.Red-Gate SQL Doc 2 16.Red-Gate...

    2013最新RedGate系列多产品注册机【爆强】

    支持产品: #Keygen supports following programs: 1.Red-Gate Reflector 8 ...17.Red-Gate SQL Object Level Recovery Native 1 18.Red-Gate SQL Packager 6 运行时报木马,请在360沙箱模式下运行!!!

    数据库灾难性恢复(数据库技术;灾难性;恢复;数据备份)

    With the database technology in various industries and a large number of wide application in various fields, in the process of database applications, artificial misuse, human vandalism, system ...

    Walrus::fire:快速,安全和可靠的系统备份,只需几分钟即可完成设置

    使用海象,您可以备份服务,例如MySQL,PostgreSQL,Redis,etcd或间隔短且开销低的完整目录。 它支持AWS S3,digitalocean空间和任何与S3兼容的对象存储服务。 文献资料 部署方式 下载。 使它从任何地方都可执行。...

    areos:主存储库,其中包含库和守护程序的代码

    巴雷奥斯 是一种可靠的跨网络开源软件,用于为所有完善的操作系统进行数据的备份,存档和恢复。 Bareos的功能包括: 真正的开源软件; 没有开放核或其他限制; 许可证AGPLv3 基于网络 后端包括Ceph,Gluster,S3 ...

Global site tag (gtag.js) - Google Analytics