当前位置:网站首页>MySQL log
MySQL log
2022-07-01 13:49:00 【Little program ape CCC】
redolog and binlog
- redolog yes innodb Self contained ,binlog yes mysql Self contained
- redolog It is similar to buffer , Write the transaction information to this buffer , With redolog The database can crash and restart without losing data ,innodb_flush_log_at_trx_commit Set to 1 You can persist transactions to disk every time ,innodb_log_buffer_size Is the cache size
- binlog Is to record the log of logic modification ,sync_binlog Set to 1 Can guarantee binlog Don't lose
- Timing by mysqldump Backup database , according to binlog Recover data in time
mysqldump
- mysqldump -u root -p --databases xx xxx xx > xx.sql Save multiple databases
- mysqldump -u root -p aaa bbb > xx.sql aaa Library bbb surface
- mysqldump -u root -p --no-data As long as the table structure
binlog
- show variables like ‘%bin%’ see binlog Open or not
- If it is not opened, it is my.cnf Of mysqld Add below log_bin=mysql-bin
- show binlog events in ‘mysql-bin.00000x’; see binlog
- mysqlbinlog binlog The full path -d Database name --skip-gtids --start-position= Serial number --stop-position= Serial number > xx.sql binlog Convert to corresponding sql
- –start-datetime,–start-position and –stop-position All optional parameters
- binlog It is divided into 3 Two recording modes ,statement,row and mixed
- statement: Record native sql, It is possible that the master-slave execution will be inconsistent , Not recommended
- row: Record information , Executive sql The amount of data is very large and takes up a lot of space
- mixed: Top two blends , If mysql If you think there will be no inconsistency, use statement Record , Too much data to use row Record
undolog
- Reverse operation of record operation , Used to rollback and maintain consistency
边栏推荐
- 面试题目总结(1) https中间人攻击,ConcurrentHashMap的原理 ,serialVersionUID常量,redis单线程,
- 1. Sum of two numbers: given an integer array num and an integer target value, please find the two integers whose sum is the target value target in the array and return their array subscripts
- 【NLP】预训练模型——GPT1
- 详细讲解面试的 IO多路复用,select,poll,epoll
- IO的几种模型 阻塞,非阻塞,io多路复用,信号驱动和异步io
- C语言订餐管理系统
- 清华章毓晋老师新书:2D视觉系统和图像技术(文末送5本)
- Understand the window query function of tdengine in one article
- Grafana reports an error: error= "failed to send notification to email addresses: [email protected] : 535 Error:
- el-form-item 正则验证
猜你喜欢

孔松(信通院)-数字化时代云安全能力建设及趋势

04 redis source code data structure dictionary

刘对(火线安全)-多云环境的风险发现

【241. 为运算表达式设计优先级】

当你真的学会DataBinding后,你会发现“这玩意真香”!

Build a vc2010 development environment and create a tutorial of "realizing Tetris game in C language"

Computer network interview knowledge points

开源者的自我修养|为 ShardingSphere 贡献了千万行代码的程序员,后来当了 CEO

Liu Dui (fire line safety) - risk discovery in cloudy environment

开源实习经验分享:openEuler软件包加固测试
随机推荐
Liu Dui (fire line safety) - risk discovery in cloudy environment
About fossage 2.0 "meta force meta universe system development logic scheme (details)
【NLP】预训练模型——GPT1
关于佛萨奇2.0“Meta Force原力元宇宙系统开发逻辑方案(详情)
How much money do novices prepare to play futures? Is agricultural products OK?
el-form-item 正则验证
8款最佳实践,保护你的 IaC 安全!
用命令行 给 apk 签名
leetcode 322. Coin change (medium)
LeetCode重建二叉树详解[通俗易懂]
开源实习经验分享:openEuler软件包加固测试
单工,半双工,全双工区别以及TDD和FDD区别
【剑指 Offer】55 - II. 平衡二叉树
焱融看 | 混合云时代下,如何制定多云策略
[NLP] pre training model - gpt1
[flask] flask starts and implements a minimal application based on flask
Analysis report on the development trend and prospect scale of silicon intermediary industry in the world and China Ⓩ 2022 ~ 2027
8 popular recommended style layout
AnimeSR:可学习的降质算子与新的真实世界动漫VSR数据集
使用 Lambda 函数URL + CloudFront 实现S3镜像回源