MySQL Replication using GTID

by Hooman Bahreini   Last Updated May 16, 2019 02:06 AM

I want to create MySQL replication using GTID.

According to MySQL Manual I need the following settings in my.cnf (for the master)

server-id       = 1
log_bin         = /var/log/mysql/mysql-bin.log
gtid_mode = ON
log-slave-updates
enforce-gtid-consistency

I have also seen this guide, which suggests the following settings in my.cnf (for master):

log-bin = mysql-bin
server-id = 1
relay-log = relay-log-slave
gtid-mode =ON
enforce-gtid-consistency
binlog_format = MIXED
log_slave_updates

Questions:

  1. I have noticed that underscore and dash are being used loosely in the documents, for example when I installed MySQL on my computer, the variable name is log_bin but in MySQL manual they are using log-bin. Are _ and - interchangeable?

  2. In the second tutorial that I have linked they are setting these two values in addition to setting values from MySQL manual: relay-log = relay-log-slave and relay-log = relay-log-slave. What are these two settings? And do I need them?



Answers 1


_ and - are interchangeable in configuration files, however as SQL system variables only _ is supported.

relay-log is a variable. relay-log-slave is just a value string.

danblack
danblack
May 16, 2019 01:51 AM

Related Questions


Updated January 11, 2018 08:06 AM

Updated February 20, 2019 05:06 AM

Updated April 04, 2017 11:06 AM

Updated April 26, 2017 23:06 PM