当前位置:网站首页>Mysql database binlog log enable record
Mysql database binlog log enable record
2022-07-03 06:09:00 【vincentwc】
binlog Open Settings
win10
view the database binlog Whether to open
show variables like 'log_bin';
show variables like 'log_bin%';
open binlog journal
2.1 find mysql Configuration file for mysql.ini【 stay mysql Installation directory 】
2.2 stay mysqld The configuration is as follows
# Turn on binlog journal server_id=1 log-bin=mysql-bin binlog-format=ROW
binlog-format: There are three forms of master-slave synchronization
statement Will operate on the database sql The statement is written to binlog in
row Every data change will be written to binlog in .
mixed statement And row Mixing .Mysql Decide when to write statement Format , When to write row Format binlog
2.3 Restart the service , Check again
net stop mysql net start mysql
show variables like 'log_bin%';
linux
see binlog state
Locate the configuration file and modify it
The location of the configuration file
/etc/my.cnf
Add the configuration
# Turn on binary log server-id=1 log-bin=/usr/local/mysql/data/mysql-bin
docker
The configuration is mapped to a local file , The local file configuration is as follows
[mysqld] #binlog setting log-bin=/var/lib/mysql/mysql-bin server-id=123454 binlog-format=ROW
restart mysql, Search found binlog It's not turned on
docker restart mysql
It took a long time to find this hole on the Internet , Record the process
First , see docker About my.cnf I found this sentence in my log :
mysqld: [Warning] World-writable config file '/etc/mysql/``my.cnf``' is ignored.
Viewing on the Internet is caused by the permission of the configuration file https://blog.csdn.net/qilovehua/article/details/45508925, For details, please refer to this blog post
Then enter docker Of mysql Container to check , Sure enough my.cnf The permissions for are 777
Change it to 644
chmod 644 my.cnf
Restart again mysql Containers , Check it out binlog Successfully opened
however , If you make any changes to the mapped configuration file later , He will be mapped again to /etc/mysql/my.cnf This file and the permissions are reset to 777, Need to modify again
边栏推荐
- [system design] proximity service
- 伯努利分布,二项分布和泊松分布以及最大似然之间的关系(未完成)
- QT read write excel -- qxlsx insert chart 5
- 1. 两数之和
- Pytorch dataloader implements minibatch (incomplete)
- Simple understanding of ThreadLocal
- Leetcode solution - 02 Add Two Numbers
- pytorch 多分类中的损失函数
- Solve the 1251 client does not support authentication protocol error of Navicat for MySQL connection MySQL 8.0.11
- There is no one of the necessary magic skills PXE for old drivers to install!!!
猜你喜欢
[video of Teacher Zhao Yuqiang's speech on wot] redis high performance cache and persistence
Cesium 点击获三维坐标(经纬度高程)
[teacher Zhao Yuqiang] index in mongodb (Part 2)
Zhiniu stock project -- 04
深入解析kubernetes controller-runtime
How to create and configure ZABBIX
[teacher Zhao Yuqiang] redis's slow query log
Maximum likelihood estimation, divergence, cross entropy
tabbar的设置
[Zhao Yuqiang] deploy kubernetes cluster with binary package
随机推荐
Project summary --04
Merge and migrate data from small data volume, sub database and sub table Mysql to tidb
GPS坐标转百度地图坐标的方法
Simple understanding of ThreadLocal
从小数据量 MySQL 迁移数据到 TiDB
Kubernetes notes (I) kubernetes cluster architecture
1. 兩數之和
智牛股项目--05
Skywalking8.7 source code analysis (I): agent startup process, agent configuration loading process, custom class loader agentclassloader, plug-in definition system, plug-in loading
[teacher Zhao Yuqiang] MySQL high availability architecture: MHA
Kubernetes notes (IV) kubernetes network
If function of MySQL
[teacher Zhao Yuqiang] RDB persistence of redis
phpstudy设置项目可以由局域网的其他电脑可以访问
Zhiniu stock project -- 05
卷积神经网络CNN中的卷积操作详解
理解 YOLOV1 第一篇 预测阶段
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
从小数据量分库分表 MySQL 合并迁移数据到 TiDB
Oauth2.0 - user defined mode authorization - SMS verification code login