当前位置:网站首页>Open MySQL binlog log on Linux
Open MySQL binlog log on Linux
2022-07-22 19:56:00 【Network stupid pig】
linux Turn on MySQL binlog journal
binlog journal , namely binary log, It's a binary log file . It has two functions , One is incremental backup , That is, only the newly added content is backed up ; Second, it is used for master-slave replication, etc , That is, the master node maintains a binlog Log files , Slave node slave binlog Data synchronization in . We can go through binlog Log recovery data . Let's talk about opening MySQL binlog The process of logging :
1、 Sign in MySQL, see binlog The status of the log
Sign in MySQL after , Input show variables like '%log_bin%'; Check out binlog Log for OFF The closed position ;
2、 Turn on MySQL binlog journal
sign out MySQL, Use vi Editor changes MySQL Of my.cnf The configuration file
stay my.cnf Add two sentences as shown in the following figure to the configuration file
Save exit after adding
server-id Representing a single node id, Because there is only one node , So you can put id Randomly assigned to a number , There will be id Set to 1. If there are multiple nodes in the cluster , be id Cannot be the same
The second sentence is designated binlog The name of the log file is mysql-bin, And its storage path
3、 restart MySQL
see /var/lib/mysql Contents under the directory
Use command :ls /var/lib/mysql;
Be careful : Every time the server ( database ) restart , The server will call flush logs;, Create a new binlog journal
Because I've restarted the database before , So here is mysql-bin.000001 To mysql-bin.000003 These three files . What you see here
It should be mysql-bin.000001 and mysql-bin.index Two documents
Now enter again MySQL, see binlog The status of the log . Show binlog Log for ON On state
Here we are ,binlog The log is opened successfully .
边栏推荐
- ES6新特性分享(完结)
- Spark RDD operator: partition operation, mappartitions and mappartitionswithindex
- 数据架构与数据库建模
- Installation of mysql5.7 (yum, binary, compile and install)
- 文献记录(part109)--Self-Representation Based Unsupervised Exemplar Selection in a Union of Subspaces
- Several common ways for C DataGridView to bind data sources
- Vs Code common shortcut keys
- 模块与组件、模块化与组件化的理解分析
- promise
- Why choose b+ tree for index
猜你喜欢
Datablau5.0数据资产管理产品系列重磅发布
NewSQL数据库数据模型设计
As a beginner, I don't want to use eslint
数据仓库模型设计与工具
MySQL converts milliseconds into time string
ping: www.baidu.com: 未知的名称或服务原因分析
Causal of maxscale_ Reads parameter
Data architecture and database modeling
How Oracle escapes single quotation marks
从数据标准到数据库设计:解决基础数据标准落地的最后一公里难题(下)
随机推荐
leetcode 21. 合并两个有序链表
leetcode 22. 括号生成
Installation of mysql5.7 (yum, binary, compile and install)
记一次优化我的个人博客
ES6 new features sharing (IV)
shell中小数运算(bc)
ES6 new features sharing (III)
Understanding and analysis of modules and components, modularity and componentization
关闭浏览器 如何清除localStorage数据
mysql 主从同步出问题,重新修复从库(转)
Win10图标变白纸了,恢复方法
Spark RDD算子:RDD分区,HashPartitioner、RangePartitioner、自定义分区
开幕在即 | “万物互联,使能千行百业”2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛
VS2017项目改为VS2010
Summary of MySQL grant user permissions
ping: www.baidu.com: 未知的名称或服务原因分析
Spark GraphX 中的 pregel函数(转载)
ES6新特性分享(三)
shell脚本
AForge “未能加载文件或程序集“AForge.Video.FFMPEG.dll”或它的某一个依赖项。找不到指定的模块”