当前位置:网站首页>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
边栏推荐
- Pytorch dataloader implements minibatch (incomplete)
- 1. 两数之和
- phpstudy设置项目可以由局域网的其他电脑可以访问
- Creating postgre enterprise database by ArcGIS
- Zhiniu stock project -- 04
- Crontab command usage
- Convolution operation in convolution neural network CNN
- 1. 兩數之和
- How to create and configure ZABBIX
- The most responsible command line beautification tutorial
猜你喜欢
Method of converting GPS coordinates to Baidu map coordinates
[teacher Zhao Yuqiang] MySQL high availability architecture: MHA
最大似然估计,散度,交叉熵
Oauth2.0 - Introduction and use and explanation of authorization code mode
ThreadLocal的简单理解
Code generator - single table query crud - generator
伯努利分布,二项分布和泊松分布以及最大似然之间的关系(未完成)
[Zhao Yuqiang] deploy kubernetes cluster with binary package
Clickhouse learning notes (I): Clickhouse installation, data type, table engine, SQL operation
Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
随机推荐
[teacher Zhao Yuqiang] calculate aggregation using MapReduce in mongodb
[video of Teacher Zhao Yuqiang's speech on wot] redis high performance cache and persistence
輕松上手Fluentd,結合 Rainbond 插件市場,日志收集更快捷
Cesium 点击获取模型表面经纬度高程坐标(三维坐标)
Alibaba cloud Alipay sandbox payment
Oauth2.0 - explanation of simplified mode, password mode and client mode
Oauth2.0 - Introduction and use and explanation of authorization code mode
Txt document download save as solution
从小数据量分库分表 MySQL 合并迁移数据到 TiDB
Migrate data from Mysql to tidb from a small amount of data
[teacher Zhao Yuqiang] index in mongodb (Part 1)
MySQL帶二進制的庫錶導出導入
Jedis source code analysis (I): jedis introduction, jedis module source code analysis
从 Amazon Aurora 迁移数据到 TiDB
Leetcode solution - 01 Two Sum
Redhat7 system root user password cracking
Core principles and source code analysis of disruptor
项目总结--04
Jedis source code analysis (II): jediscluster module source code analysis
How does win7 solve the problem that telnet is not an internal or external command