当前位置:网站首页>my.cnf中 [mysql]与[mysqld] 的区别 引起的binlog启动失败的问题
my.cnf中 [mysql]与[mysqld] 的区别 引起的binlog启动失败的问题
2022-06-11 11:05:00 【孤鸿踏雪】
实施同事用我给的文档部署mysql主主配置的时候,发现binlog没有启动
我看了下配置:
my.cnf
[client]
port=3306
socket=/mnt/hwb/mysql/mysqlinstall/public/mysql/mysql.sock
[mysql]
server-id=1
auto_increment_offset=1
auto_increment_increment=2
default-character-set=utf8
log-bin=mysql-bin
log-slave-updates=true
#gtid-mode=on
#enforce-gtid-consistency=truemasterB:
master-info-repository=TABLE
relay-log-info-repository=TABLE
sync-master-info=1
slave-parallel-workers=0
sync_binlog=0
max_binlog_size=100M
binlog_format=row
expire_logs_days = 15
innodb_flush_log_at_trx_commit=0
replicate_wild_ignore_table =mysql.%
replicate_wild_ignore_table =test.%
replicate_wild_ignore_table =information_schema.%
replicate_wild_ignore_table =performance_schema.%
max_connect_errors=30
slave_skip_errors=ddl_exist_errors
skip-character-set-client-handshake
init-connect='SET NAMES utf8'
character-set-server=utf8
wait_timeout=1800
interactive_timeout=1800
skip-name-resolve
no-beep
[mysqld]
basedir=/mnt/hwb/mysql/mysqlinstall/public/mysql
datadir=/mnt/hwb/mysql/mysqlinstall/public/mysql/data
port=3306
socket=/mnt/hwb/mysql/mysqlinstall/public/mysql/mysql.sock
log_error=/mnt/hwb/mysql/mysqlinstall/public/mysql/error.log
character-set-server=utf8
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
default-storage-engine=INNODB
max_connections=1000
lower_case_table_names=1
skip-name-resolve
发现有:“log-bin=mysql-bin”说明是设置了启动binlog的,在客户端执行命令:

第一次遇到执行show master status;
什么都没有,在网上搜索了很多为了binlog设置失败,找不到问题,于是问了一个大神,大神说:
所有参数要写到[mysqld]下面
顿时一惊,然后明白了问题,因为配置文件一开始不是本人加的,还没注意这个问题。
附上一个链接:http://blog.itpub.net/31397003/viewspace-2651459/
关于my.cnf里面几个配置的区别:
[client]代表客户端默认设置内容;
[mysql]代表我们使用mysql命令登录mysql数据库时的默认设置;
[mysqld]代表数据库自身的默认设置;
修改后,重新执行启动,没问题了,特此记录下。
与君共勉!
边栏推荐
- 拆分数据---水平拆分和纵向拆分
- SAP Spartacus Reference App Structure
- WordPress重新生成特色图像插件:Regenerate Thumbnails
- SurroundDepth:自监督多摄像头环视深度估计
- 985 University doctors became popular because of their thanks in classical Chinese! The tutor commented that he not only wrote well in sci
- AI security and Privacy Forum issue 11 - stable learning: finding common ground between causal reasoning and machine learning
- 木瓜移动CFO刘凡 释放数字时代女性创新力量
- 1712. 将数组分成三个子数组的方案数 ●●
- Only when you find your own advantages can you work tirelessly and get twice the result with half the effort!
- 修改 WordPress 管理账号名称插件:Admin renamer extended
猜你喜欢

How to form a good habit? By perseverance? By determination? None of them!

杰理之获取 BLE OTA 双备份升级(只能用于 4Mbits 以上的芯片)【篇】

Shi Yigong: I was not interested in research until I graduated from my doctor's degree! I'm confused about the future, and I don't know what to do in the future

Introduction to thread pool: ThreadPoolExecutor

Command mode - attack, secret weapon

如何养成一个好习惯?靠毅力?靠决心?都不是!

Only when you find your own advantages can you work tirelessly and get twice the result with half the effort!

Method of converting VOC format data set to Yolo format data set

CAP理论听起来很高大上,其实很简单

Introduction to database system -- Chapter 2 -- relational database (2.4 relational algebra)
随机推荐
Processing of uci-har datasets
使用Labelimg制作VOC数据集或yolo数据集的入门方法
测试cos-html-cache静态缓存插件
全国多年太阳辐射空间分布数据1981-2022年、气温分布数据、蒸散量数据、蒸发量数据、降雨量分布数据、日照数据、风速数据
Can't you be free without wealth?
Jerry's acquisition of ble distinguishes between reset and wake-up [chapter]
Summary of information of main account of Chia Tai futures on Wednesday in advance
如何养成一个好习惯?靠毅力?靠决心?都不是!
把程序写进微控制器里可以更方便快捷的控制电机正反转
Installing redis in CentOS 7 environment
Tu ne peux pas être libre sans richesse?
Jerry's blepr0 and PR1 are used as ordinary IO ports [chapter]
Exness: the progress of Russia Ukraine negotiations is limited, and the RBA's decision remains unchanged
杰理之BLE SPP 开启 pin_code 功能【篇】
使用Yolov5训练自己制作的数据集,快速上手
找到自己的优势,才能干活不累,事半功倍!
34. find the first and last positions of elements in the sorted array ●●
Working principle analysis of rxjs fromEvent
1712. 将数组分成三个子数组的方案数 ●●
Vscode——vscode 多窗口名字配置成项目名字