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高级指引

    深入JSX 本质上来讲,JSX是为React.createElement方法提供的语法糖 <MyButton color=}> Click Me </MyButton> 编译为 ...

  2. Angular6 Observable.fromEvent error: “Invalid event target”

    今天在angular6项目中写了个拖拽功能,但是控制台报错,如图 后来在控制台打出发现,原来是 ngOnInit( ) 这个生命周期里,页面的dom节点还未产生,还只是null. 改为用 ngAfte ...

  3. Tensorflow数学运算

    一.Tensor 之间的运算规则 1) 相同大小 Tensor 之间的任何算术运算都会将运算应用到元素级 2) 不同大小 Tensor(要求dimension 0 必须相同) 之间的运算叫做广播(br ...

  4. OO第二单元(电梯)单元总结

    OO第一单元(求导)单元总结 这是我们OO课程的第二个单元,这个单元的主要目的是让我们熟悉理解和掌握多线程的思想和方法.这个单元以电梯为主题,从一开始的最简单的单部傻瓜调度(FAFS)电梯到最后的多部 ...

  5. JSON语法

    JSON:JavaScript 对象表示法(JavaScript Object Notation). JSON 是存储和交换文本信息的语法.类似 XML. JSON 比 XML 更小.更快,更易解析. ...

  6. Linux 总线、设备、驱动模型 与 设备树

    1.总线.设备.驱动模型 本着高内聚.低耦合的原则,Linux 把设备驱动模型分为了总线.设备和驱动三个实体,这三个实体在内核里的职责分别如下: 设备和驱动向总线进行注册,总线负责把设备和对应的驱动绑 ...

  7. codeblock 恢复默认字体设置

    默认字体为:Courier New   我使用的codeblock版本为:17 .12. 今天我想调整一下codeblock的代码驱的字体,根据设置:settings->Editor->F ...

  8. java学习--Iterable 和 Iterator

    Iterable Iterable :故名思议,实现了这个接口的集合对象支持迭代,是可迭代的. 一个集合对象要表明自己支持迭代,能有使用foreach语句的特权,就必须实现Iterable接口,表明我 ...

  9. JSP 有些类can not be resolved

    看了网上的帖子,切换了jdk到低版本,发现还是不能解决问题. 发现出现问题的代码在tomcat下的Lib包中的其中一个包,jasper.jar 我在想是不是tomcat的版本问题,拷贝了其他地方的ja ...

  10. Centos 7 安装composer和Laravel

    composer安装 我安装了lnmp到Centos7里,所以可以直接运行curl -sS https://getcomposer.org/installer | php把安装的composer.ph ...