当前位置:网站首页>MySQL日志
MySQL日志
2022-07-01 13:48:00 【小小程序猿ccc】
redolog和binlog
- redolog是innodb自帶的,binlog是mysql自帶的
- redolog就是類似於緩沖區,將事務的信息寫入這個緩沖區,有了redolog數據庫就可以崩潰重啟數據不丟,innodb_flush_log_at_trx_commit設置為1可以每次都把事務持久化到磁盤,innodb_log_buffer_size是緩存區大小
- binlog就是記錄了邏輯修改的日志,sync_binlog設置為1可以保證binlog不丟
- 定時通過mysqldump備份數據庫,根據binlog時間段恢複數據
mysqldump
- mysqldump -u root -p --databases xx xxx xx > xx.sql 保存多個數據庫
- mysqldump -u root -p aaa bbb > xx.sql aaa庫的bbb錶
- mysqldump -u root -p --no-data 只要錶結構
binlog
- show variables like ‘%bin%’ 查看binlog是否開啟
- 沒有打開的話在my.cnf的mysqld下邊加上log_bin=mysql-bin
- show binlog events in ‘mysql-bin.00000x’; 查看binlog
- mysqlbinlog binlog全路徑 -d 數據庫名 --skip-gtids --start-position=序號 --stop-position=序號 > xx.sql binlog轉換成對應的sql
- –start-datetime,–start-position和–stop-position都是可選參數
- binlog分為3種記錄模式,statement,row和 mixed
- statement:記錄原生sql,有可能主從執行會出現不一致,不推薦
- row:記錄信息,執行的sql數據量很大會很占空間
- mixed:上邊兩個混合,如果mysql認為不會出現不一致則使用statement記錄,數據量太大使用row記錄
undolog
- 記錄操作的反操作,用來回滾保持一致性
边栏推荐
- Qtdeisgner, pyuic detailed use tutorial interface and function logic separation (nanny teaching)
- 【NLP】预训练模型——GPT1
- 5. Use of ly tab plug-in of header component
- 刘对(火线安全)-多云环境的风险发现
- word2vec训练中文词向量
- Use of shutter SQLite
- Grafana reports an error: error= "failed to send notification to email addresses: [email protected] : 535 Error:
- B站被骂上了热搜。。
- 当你真的学会DataBinding后,你会发现“这玩意真香”!
- 基于算力驱动、数据与功能协同的分布式动态(协同)渲染/功能运行时
猜你喜欢

佩服,阿里女程序卧底 500 多个黑产群……

奔涌而来的数字化浪潮,将怎样颠覆未来?

French Data Protection Agency: using Google Analytics or violating gdpr

2022年PMP项目管理考试敏捷知识点(6)

2022上半年英特尔有哪些“硬核创新”?看这张图就知道了!

Dragon lizard community open source coolbpf, BPF program development efficiency increased 100 times

【Flask】Flask启程与实现一个基于Flask的最小应用程序

The best landing practice of cave state in an Internet ⽹⾦ financial technology enterprise

minimum spanning tree
![[NLP] pre training model - gpt1](/img/bd/9803ad946b33159de51b93106a2151.png)
[NLP] pre training model - gpt1
随机推荐
[241. Design priority for operation expression]
Introduction to topological sorting
[安网杯 2021] REV WP
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
Summary of 20 practical typescript single line codes
String input function
10. Page layout, guess you like it
QT learning management system
二传感器尺寸「建议收藏」
2022 · 让我带你Jetpack架构组件从入门到精通 — Lifecycle
Anti fraud, refusing to gamble, safe payment | there are many online investment scams, so it's impossible to make money like this
6. Wiper part
详细讲解面试的 IO多路复用,select,poll,epoll
Self cultivation of open source programmers who contributed tens of millions of lines of code to shardingsphere and later became CEO
一文读懂TDengine的窗口查询功能
开源者的自我修养|为 ShardingSphere 贡献了千万行代码的程序员,后来当了 CEO
When you really learn databinding, you will find "this thing is really fragrant"!
Animesr: learnable degradation operator and new real world animation VSR dataset
Camp division of common PLC programming software
奔涌而来的数字化浪潮,将怎样颠覆未来?