当前位置:网站首页>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
边栏推荐
- Solution to 0xc000007b error when running the game [easy to understand]
- Dragon lizard community open source coolbpf, BPF program development efficiency increased 100 times
- 清华章毓晋老师新书:2D视觉系统和图像技术(文末送5本)
- Etcd summary mechanism and usage scenarios
- Introduction to topological sorting
- 分布式事务简介(seata)
- 6年技术迭代,阿里全球化出海&合规的挑战和探索
- Etcd 概要 机制 和使用场景
- Station B was scolded on the hot search..
- el-form-item 正则验证
猜你喜欢

MySQL六十六问,两万字+五十图详解!复习必备

清华章毓晋老师新书:2D视觉系统和图像技术(文末送5本)

建立自己的网站(21)

焱融看 | 混合云时代下,如何制定多云策略

Understand the window query function of tdengine in one article

【IoT毕设.下】STM32+机智云AIoT+实验室安全监控系统

Computer network interview knowledge points

QT学习管理系统

SAP intelligent robot process automation (IRPA) solution sharing

Introduction to distributed transactions (Seata)
随机推荐
8 popular recommended style layout
【241. 为运算表达式设计优先级】
Animesr: learnable degradation operator and new real world animation VSR dataset
User defined annotation realizes the function of verifying information
Station B was scolded on the hot search..
A new book by teacher Zhang Yujin of Tsinghua University: 2D vision system and image technology (five copies will be sent at the end of the article)
2022年PMP项目管理考试敏捷知识点(6)
Spark source code reading outline
JVM有哪些类加载机制?
String input function
Kongsong (Xintong Institute) - cloud security capacity building and trend in the digital era
[machine learning] VAE variational self encoder learning notes
uni-app实现广告滚动条
C language ordering management system
QT学习管理系统
spark源码(五)DAGScheduler TaskScheduler如何配合提交任务,application、job、stage、taskset、task对应关系是什么?
Analysis report on the development trend and Prospect of new ceramic materials in the world and China Ⓐ 2022 ~ 2027
2022上半年英特尔有哪些“硬核创新”?看这张图就知道了!
Analysis report on the development trend and prospect scale of silicon intermediary industry in the world and China Ⓩ 2022 ~ 2027
3.4 《数据库系统概论》之数据查询—SELECT(单表查询、连接查询、嵌套查询、集合查询、多表查询)