title: Error: Binlogging on server not active when setting up Master Slave replication on one machine
body: <p>I am trying to set up Master Slave Replication on my local machine using <a href="https://www.toptal.com/mysql/mysql-master-slave-replication-tutorial" rel="noreferrer">this tutorial</a>.</p>
  
  <p>I am close to the end but when I try to run <code>mysqldump</code> using the <code>--master-data=2</code> I get an error</p>
  
  <pre><code>mysqldump: Error: Binlogging on server not active
  </code></pre>
  
  <p>All the solutions I've come across have said to add <code>log_bin = /var/log/mysql/mysql-bin.log</code> to <code>my.cnf</code> which I have done and it doesn't seem to solve the issue.</p>
  
  <p>This is my <code>my.cnf</code> file:</p>
  
  <pre><code>[client]
  port            = 3306
  socket          = /var/run/mysqld/mysqld.sock
  
  [mysqld_safe]
  pid-file        = /var/run/mysqld/mysqld.pid
  socket          = /var/run/mysqld/mysqld.sock
  nice            = 0
  
  [mysqld_multi]
  mysqld      = /usr/bin/mysqld_safe
  mysqladmin  = /usr/bin/mysqladmin
  user        = multi_admin
  password    = multipass
  
  [mysqld2]
  user            = mysql
  pid-file        = /var/run/mysqld/mysqld_slave.pid
  socket          = /var/run/mysqld/mysqld_slave.sock
  port            = 3307
  basedir         = /usr
  datadir         = /var/lib/mysql_slave
  tmpdir          = /tmp
  lc-messages-dir = /usr/share/mysql
  explicit_defaults_for_timestamp
  server-id   = 2
  relay-log   = /var/log/mysql_slave/relay-bin
  relay-log-index = /var/log/mysql_slave/relay-bin.index
  master-info-file = /var/log/mysql_slave/master.info
  relay-log-info-file = /var/log/mysql_slave/relay-log.info
  read_only   = 1
  
  [mysqld1]
  user            = mysql
  pid-file        = /var/run/mysqld/mysqld.pid
  socket          = /var/run/mysqld/mysqld.sock
  port            = 3305
  basedir         = /usr
  datadir         = /var/lib/mysql
  tmpdir          = /tmp
  lc-messages-dir = /usr/share/mysql
  explicit_defaults_for_timestamp
  server-id   = 1
  log_bin     = /var/log/mysql/mysql-bin.log
  innodb_flush_log_at_trx_commit = 1
  sync_binlog = 1
  binlog-format = ROW
  
  # Instead of skip-networking the default is now to listen only on
  # localhost which is more compatible and is not less secure.
  bind-address = 0.0.0.0
  
  log-error       = /var/log/mysql/error.log
  
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  
  # * IMPORTANT: Additional settings that can override those from this file!
  #   The files must end with '.cnf', otherwise they'll be ignored.
  
  !includedir /etc/mysql/conf.d/
  </code></pre>