当前位置:网站首页>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
边栏推荐
- 使用 Lambda 函数URL + CloudFront 实现S3镜像回源
- Spark source code (V) how does dagscheduler taskscheduler cooperate with submitting tasks, and what is the corresponding relationship between application, job, stage, taskset, and task?
- 【机器学习】VAE变分自编码器学习笔记
- Analysis report on the development trend and Prospect of new ceramic materials in the world and China Ⓐ 2022 ~ 2027
- Fiori applications are shared through the enhancement of adaptation project
- 2022 · 让我带你Jetpack架构组件从入门到精通 — Lifecycle
- 新手准备多少钱可以玩期货?农产品可以吗?
- Leetcode question 1: sum of two numbers (3 languages)
- 焱融看 | 混合云时代下,如何制定多云策略
- Interpretation of R & D effectiveness measurement framework
猜你喜欢
MySQL 66 questions, 20000 words + 50 pictures in detail! Necessary for review
[241. Design priority for operation expression]
使用CMD修复和恢复病毒感染文件
佩服,阿里女程序卧底 500 多个黑产群……
5. Use of ly tab plug-in of header component
Learning to use livedata and ViewModel will make it easier for you to write business
用栈实现队列、用队列实现栈(C语言_leetcode_232+225)
[NLP] pre training model - gpt1
French Data Protection Agency: using Google Analytics or violating gdpr
一文读懂TDengine的窗口查询功能
随机推荐
Leetcode第一题:两数之和(3种语言)
Analysis report on the development prospect and investment strategy of the global and Chinese laser chip industry Ⓑ 2022 ~ 2027
日志中打印统计信息的方案
Analysis report on the development trend and prospect scale of silicon intermediary industry in the world and China Ⓩ 2022 ~ 2027
SAP 智能机器人流程自动化(iRPA)解决方案分享
运行游戏时出现0xc000007b错误的解决方法[通俗易懂]
Learning to use livedata and ViewModel will make it easier for you to write business
网络中的listen
Anti fraud, refusing to gamble, safe payment | there are many online investment scams, so it's impossible to make money like this
队列的基本操作(C语言实现)
[NLP] pre training model - gpt1
C language course design topic
一文读懂TDengine的窗口查询功能
5. Use of ly tab plug-in of header component
Global and Chinese polypropylene industry prospect analysis and market demand forecast report Ⓝ 2022 ~ 2027
C语言订餐管理系统
C语言课程设计题目
Simplex, half duplex, full duplex, TDD and FDD
Investment analysis and prospect prediction report of global and Chinese p-nitrotoluene industry Ⓙ 2022 ~ 2027
GET请求如何传递数组参数