当前位置:网站首页>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
- 记录操作的反操作,用来回滚保持一致性
边栏推荐
- 【241. 为运算表达式设计优先级】
- MySQL 66 questions, 20000 words + 50 pictures in detail! Necessary for review
- String input function
- 2022上半年英特尔有哪些“硬核创新”?看这张图就知道了!
- uni-app实现广告滚动条
- [machine learning] VAE variational self encoder learning notes
- 二传感器尺寸「建议收藏」
- Explain IO multiplexing, select, poll, epoll in detail
- ArrayList扩容机制以及线程安全性
- word2vec训练中文词向量
猜你喜欢

Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
![[anwangbei 2021] Rev WP](/img/98/ea5c241e2b8f3ae4c76e1c75c9e0d1.png)
[anwangbei 2021] Rev WP

IO的几种模型 阻塞,非阻塞,io多路复用,信号驱动和异步io

minimum spanning tree

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

What is the future development direction of people with ordinary education, appearance and family background? The career planning after 00 has been made clear

Self cultivation of open source programmers who contributed tens of millions of lines of code to shardingsphere and later became CEO

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

研发效能度量框架解读

SAP intelligent robot process automation (IRPA) solution sharing
随机推荐
Dragon lizard community open source coolbpf, BPF program development efficiency increased 100 times
[machine learning] VAE variational self encoder learning notes
开源实习经验分享:openEuler软件包加固测试
IO的几种模型 阻塞,非阻塞,io多路复用,信号驱动和异步io
Anti fraud, refusing to gamble, safe payment | there are many online investment scams, so it's impossible to make money like this
Introduction to distributed transactions (Seata)
Global and Chinese polypropylene industry prospect analysis and market demand forecast report Ⓝ 2022 ~ 2027
Content Audit Technology
French Data Protection Agency: using Google Analytics or violating gdpr
小程序-小程序图表库(F2图表库)
Introduction to topological sorting
spark源码(五)DAGScheduler TaskScheduler如何配合提交任务,application、job、stage、taskset、task对应关系是什么?
What is the future development direction of people with ordinary education, appearance and family background? The career planning after 00 has been made clear
04-Redis源码数据结构之字典
焱融看 | 混合云时代下,如何制定多云策略
3.4 data query in introduction to database system - select (single table query, connection query, nested query, set query, multi table query)
Analysis report on the development trend and prospect scale of silicon intermediary industry in the world and China Ⓩ 2022 ~ 2027
Build a vc2010 development environment and create a tutorial of "realizing Tetris game in C language"
运行游戏时出现0xc000007b错误的解决方法[通俗易懂]
Applet - multiple text line breaks in view