当前位置:网站首页>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=ROWbinlog-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 mysqlshow variables like 'log_bin%';
linux
see binlog state
Locate the configuration file and modify it
The location of the configuration file
/etc/my.cnfAdd 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 mysqlIt 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.cnfRestart 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
边栏推荐
- Code generator - single table query crud - generator
- SVN分支管理
- Fluentd facile à utiliser avec le marché des plug - ins rainbond pour une collecte de journaux plus rapide
- 智牛股项目--04
- 技术管理进阶——你了解成长的全貌吗?
- Creating postgre enterprise database by ArcGIS
- Use telnet to check whether the port corresponding to the IP is open
- Kubernetes notes (IX) kubernetes application encapsulation and expansion
- The server data is all gone! Thinking caused by a RAID5 crash
- ThreadLocal的简单理解
猜你喜欢

Zhiniu stock project -- 05

深入解析kubernetes controller-runtime
![[teacher Zhao Yuqiang] MySQL flashback](/img/93/75998e28fd309880661ea723dc8de6.jpg)
[teacher Zhao Yuqiang] MySQL flashback

How does win7 solve the problem that telnet is not an internal or external command
![[teacher Zhao Yuqiang] the most detailed introduction to PostgreSQL architecture in history](/img/18/f91d3d21a39743231d01f2e4015ef8.jpg)
[teacher Zhao Yuqiang] the most detailed introduction to PostgreSQL architecture in history

从小数据量分库分表 MySQL 合并迁移数据到 TiDB

tabbar的设置

轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷

Interesting research on mouse pointer interaction

ThreadLocal的简单理解
随机推荐
Leetcode solution - 02 Add Two Numbers
Kubesphere - set up redis cluster
Leetcode solution - 01 Two Sum
QT read write excel -- qxlsx insert chart 5
Es remote cluster configuration and cross cluster search
GPS坐标转百度地图坐标的方法
JS implements the problem of closing the current child window and refreshing the parent window
Use abp Zero builds a third-party login module (I): Principles
[teacher Zhao Yuqiang] calculate aggregation using MapReduce in mongodb
Using the ethtool command by example
SVN分支管理
How to create your own repository for software packages on Debian
Cesium 点击获三维坐标(经纬度高程)
Pytorch dataloader implements minibatch (incomplete)
Loss function in pytorch multi classification
Kubernetes notes (IX) kubernetes application encapsulation and expansion
How to create and configure ZABBIX
Crontab command usage
Alibaba cloud OOS file upload
Simple understanding of ThreadLocal