当前位置:网站首页>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]代表数据库自身的默认设置;
修改后,重新执行启动,没问题了,特此记录下。
与君共勉!
边栏推荐
- Electron桌面端开发(开发一个闹钟【完结】)
- 【C语言】anonymous/unnamed struct&&union
- Introduction and usage of Eval function
- 数字藏品app小程序公众号系统开发
- 杰理之BLE 芯片供电范围及防烧芯片措施【篇】
- Adapter mode -- can you talk well?
- MySQL optimized learning diary 10 - locking mechanism
- 拆分数据---水平拆分和纵向拆分
- 985 University doctors became popular because of their thanks in classical Chinese! The tutor commented that he not only wrote well in sci
- Using domestic MCU (national technology n32g031f8s7) to realize pwm+dma control ws2812
猜你喜欢

李飞飞:我更像物理学界的科学家,而不是工程师|深度学习崛起十年

使用Labelimg制作VOC数据集或yolo数据集的入门方法

Lifeifei: I am more like a scientist in physics than an engineer

Electron桌面端开发(开发一个闹钟【完结】)

MySQL optimized learning diary 10 - locking mechanism

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

Display of receiving address list 【 project mall 】

Command mode - attack, secret weapon

Problems encountered when using nailing intranet to penetrate and upload PHP projects

Interpreting USB3.0 test items
随机推荐
使用pydub修改wav文件的比特率,报错:C:\ProgramData\Anaconda3\lib\site-packages\pydub\utils.py:170: RuntimeWarning:
Store management skills: how to manage chain stores efficiently?
Jerry's ble spp open pin_ Code function [chapter]
Bad navigation category bar code version
Can't you be free without wealth?
数字藏品系统源码搭建
数据库系统概论 ---- 第二章 -- 关系数据库(2.4 关系代数)
Interpreting USB3.0 test items
Yibentong 1122: calculating saddle point
AcWing 1353. Ski resort design (greedy)
Jerry's acquisition of ble to check the causes of abnormal conditions such as abnormal code reset [chapter]
Where is it safer to open an account for soda ash futures? How much capital is needed to buy soda ash futures?
SAP Spartacus Reference App Structure
Content-Type: multipart/form-data; boundary=${bound}
WordPress重新生成特色图像插件:Regenerate Thumbnails
装饰模式--小美的生日蛋糕
DROID-SLAM: 用于单目双目RGBD相机的深度视觉SLAM
Digital collection system app source code
How programmers do sidelines
Problems encountered when using nailing intranet to penetrate and upload PHP projects