请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

基于GTID配置从数据库起不来了

环境:centos7 mysql8
从库配置如下:
bin_log=/var/lib/mysql/binlog
server_id = 200
#ENFORCE_GTID_CONSISTENCY = ON
gtid_mode = on
enforce-gtid-cnsistency = on
read_only = on
master_info_repository = TABLE
relay_log_info_repository = TABLE

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

从库报错信息如下:
[root@bogon ~]# systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2018-12-10 11:03:33 CST; 9s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 3155 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 3134 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 3155 (code=exited, status=1/FAILURE)
Status: “SERVER_BOOTING”

Dec 10 11:03:24 bogon systemd[1]: Starting MySQL Server…
Dec 10 11:03:33 bogon systemd[1]: mysqld.service: main process exit…E
Dec 10 11:03:33 bogon systemd[1]: Failed to start MySQL Server.
Dec 10 11:03:33 bogon systemd[1]: Unit mysqld.service entered faile…
Dec 10 11:03:33 bogon systemd[1]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

mysqld.log日志信息:
2018-12-10T03:03:28.114480Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.13) starting as process 3155
2018-12-10T03:03:32.006960Z 1 [Warning] [MY-010005] [Server] Skip re-populating collations and character sets tables in read-only mode.
2018-12-10T03:03:32.171239Z 0 [ERROR] [MY-010912] [Server] GTID_MODE = ON requires ENFORCE_GTID_CONSISTENCY = ON.
2018-12-10T03:03:32.171298Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-10T03:03:33.727341Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL.

请老师帮忙,实在找不到问题所在了,十分谢谢!

正在回答 回答被采纳积分+3

1回答

sqlercn 2018-12-10 11:15:30
GTID_MODE = ON requires ENFORCE_GTID_CONSISTENCY = ON. 你在配置中把这个前面的#号去掉就可以了
0 回复 有任何疑惑可以回复我~
  • 提问者 慕虎3045456 #1
    可是gtid_mode = on参数下已经配置这个参数了。#号注释掉的是之前尝试按日志中报错的信息配置,结果报同样的错误!
    回复 有任何疑惑可以回复我~ 2018-12-10 11:47:55
  • sqlercn 回复 提问者 慕虎3045456 #2
    看一下是不是有其它的my.cnf文件存在。
    回复 有任何疑惑可以回复我~ 2018-12-10 19:02:05
  • 提问者 慕虎3045456 回复 sqlercn #3
    [root@bogon /]# whereis my.cnf
    my: /etc/my.cnf
    [root@bogon /]#
    
    查出来就一个(虚拟机是新的,只安装了一次MSQL),是不是MySQL8的问题。
    回复 有任何疑惑可以回复我~ 2018-12-11 08:04:48
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信