当前位置:网站首页>MySQL日志
MySQL日志
2022-07-01 13:47: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
- 记录操作的反操作,用来回滚保持一致性
边栏推荐
- Flow management technology
- Analysis report on production and marketing demand and investment forecast of global and Chinese diamond powder industry Ⓤ 2022 ~ 2027
- Liu Dui (fire line safety) - risk discovery in cloudy environment
- [sword finger offer] 55 - I. depth of binary tree
- Uni app realizes advertisement scroll bar
- 详细讲解面试的 IO多路复用,select,poll,epoll
- 玩转MongoDB—搭建MongoDB集群
- Analysis report on the development trend and Prospect of new ceramic materials in the world and China Ⓐ 2022 ~ 2027
- Benefiting from the Internet, the scientific and technological performance of overseas exchange volume has returned to high growth
- C语言订餐管理系统
猜你喜欢

Application of 5g industrial gateway in scientific and technological overload control; off-site joint law enforcement for over limit, overweight and overspeed

When you really learn databinding, you will find "this thing is really fragrant"!

用栈实现队列、用队列实现栈(C语言_leetcode_232+225)

队列的基本操作(C语言实现)
![[flask] flask starts and implements a minimal application based on flask](/img/45/77df241c85c4916914a37bb78275a5.png)
[flask] flask starts and implements a minimal application based on flask

leetcode622.设计循环队列(C语言)

Kongsong (Xintong Institute) - cloud security capacity building and trend in the digital era

详细讲解面试的 IO多路复用,select,poll,epoll

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

Explain IO multiplexing, select, poll, epoll in detail
随机推荐
Applet - applet chart Library (F2 chart Library)
When you really learn databinding, you will find "this thing is really fragrant"!
MySQL 66 questions, 20000 words + 50 pictures in detail! Necessary for review
Explain IO multiplexing, select, poll, epoll in detail
[flask] flask starts and implements a minimal application based on flask
[Jianzhi offer] 54 The k-th node of binary search tree
8 popular recommended style layout
盲盒NFT数字藏品平台系统开发(搭建源码)
spark源码(五)DAGScheduler TaskScheduler如何配合提交任务,application、job、stage、taskset、task对应关系是什么?
ArrayList capacity expansion mechanism and thread safety
String input function
Fiori applications are shared through the enhancement of adaptation project
单工,半双工,全双工区别以及TDD和FDD区别
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
MySQL六十六问,两万字+五十图详解!复习必备
Several models of IO blocking, non blocking, IO multiplexing, signal driven and asynchronous IO
QT学习管理系统
基于算力驱动、数据与功能协同的分布式动态(协同)渲染/功能运行时
C语言基础知识
【241. 为运算表达式设计优先级】