MySQL中二进制日志功能默认是关闭的,查看各种开启方式后,确定在配置文件中加入如下配置来开启该功能:

[root@bogon /]# more /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
socket=/var/run/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
ft_min_word_len = 1
symbolic-links=0
max_connections=1000
max_allowed_packet=100M
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd # Remove leading # to turn on a very important data integrity option: logging
# # changes to the binary log between backups.
log_bin=mysql-bin [mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid #
# include all files from the config directory
#
!includedir /etc/my.cnf.d

然后启动MySQL报错

解决方法:

在设置 log-bin 的时候同时需要设置 server-id 变量,即在配置文件中添加:

# Remove leading # to turn on a very important data integrity option: logging
# # changes to the binary log between backups.
log_bin=mysql-bin
server-id=1

启动成功:

  

MySQL加入log_bin报错的更多相关文章

  1. CentOS命令登录MySQL时,报错ERROR 1045 (28000):

    CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解 ...

  2. mysql执行update报错1175解决方法

    mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...

  3. Mysql update in报错 [Err] 1093 - You can't specify target table 'company_info' for update in FROM clause

    Mysql update in报错 解决方案: [Err] 1093 - You can't specify target table 'company_info' for update in FRO ...

  4. mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY

    mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...

  5. MySQL主从1205报错【转】

    主从报错1205 Slave SQL thread retried transaction 10 time(s) in vain, giving up. Consider raising the va ...

  6. 远程登陆linux连接mysql root账号报错:2003-can't connect to MYSQL serve(转)

    远程连接mysql root账号报错:2003-can't connect to MYSQL serve 1.远程连接Linux系统,登录数据库:mysql -uroot -p(密码) 2.修改roo ...

  7. 远程连接mysql root账号报错:2003-can't connect to MYSQL serve(转)

    远程连接mysql root账号报错:2003-can't connect to MYSQL serve 1.远程连接Linux系统,登录数据库:mysql -uroot -p(密码) 2.修改roo ...

  8. MySQL数据源驱动报错

    报错信息:MySQL数据源驱动报错: 1.mysql8.0以上版本需要连接数据库的JDBC驱动也是8.0版本以上 com.mysql.cj.jdbc.Driver 2.MySQL高版本需要指明是否需要 ...

  9. Linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) "

    前言 作者在2021-07-21时遇到 linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localh ...

随机推荐

  1. React面试题

    React 简述下React的生命周期,性能优化在哪个生命周期,ajax操作在哪个生命周期 React中key的作用是什么 什么是虚拟DOM diff算法原理 React中refs的作用是什么

  2. [java,2018-06-26] 扑克牌抽牌求和问题

    问题: 一副扑克牌,除去大小王后共52张牌,随机从中抽八张牌,问八张牌的和最有可能是多少? 分析: 这52张牌,其实就是数字 1 2 3 ...13, 每个数字出现4次.随机抽出8个数,问组成的和最有 ...

  3. LeetCode1-5题

    1.两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标. 你可以假设每种输入只会对应一个答案.但是,你不能重复利用这个 ...

  4. (14/24) css进阶:(入门)去除冗余的css

    在平时的项目开发中,我们会引入一些框架,比如:Bootstrap,但是在项目中通常我们只使用它的一小部分,还有部分是冗余的.更有甚有时候需求更改,带来DOM结构的更改,这时候我们可能无暇关注CSS样式 ...

  5. LeetCode 145. Binary Tree Postorder Traversal 二叉树的后序遍历 C++

    Given a binary tree, return the postorder traversal of its nodes' values. Example: Input: [,,] \ / O ...

  6. MSMQ—确认队列和响应队列

    一.MSMQ——消息的响应(响应队列) 如果需要从接收程序中获得比确认消息更多的信息(消息确认参考二),就可以使用响应队列.响应队列类似于一般队列,但原始发生程序吧该队列用作接收程序,原始接收 程序把 ...

  7. 8. springboot logback 日志整合

    在resources目录下,新建log/logback-spring.xml文件,内容如下: <?xml version="1.0" encoding="UTF-8 ...

  8. 如何系统的学习Java

    初学者记住一点,学习Java一定是连续性的且循序渐进的“系统化”学习,首先我给你提供一个优秀Java工程师的学习路线. web前端方面:html.css,Java.jQuery.xml解析.Boots ...

  9. FLV 格式导入 视频

  10. 一个PHP session的误区,自己留着长记性看看

    最近在研究PHP session相关的东西,销毁session根据手册使用session_destroy()就可以了,但是天真的以为销毁了会话就可以把会话内容也销毁,但是实际上会话的内容还保存在内存里 ...