IT运维笔记


MySQL日志报错'haven't provided the mandatory server-id'

启动MySQL报错日志:

2018-03-19T09:30:20.325988Z 0 [ERROR] You have enabled the binary log, but you haven't provided the mandatory server-id. Please refer to the proper server start-up parameters documentation 2018-03-19T09:30:20.326024Z 0 [ERROR] Aborting 2018-03-19T09:30:20.326035Z 0 [Note] Binlog end

报错的原因:

在设置bin log日志的时候,没有设置server_id参数。 server-id参数用于在复制中,为主库和备库提供一个独立的ID,以区分主库和备库;开启二进制文件的时候,需要设置这个参数。

解决方法:

vim /etc/my.cnf #bin log server_id=100 log-bin=/log/product-bin