Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save v0112358/bdbee75d8d5e98ab70a2cd371d800afa to your computer and use it in GitHub Desktop.
Save v0112358/bdbee75d8d5e98ab70a2cd371d800afa to your computer and use it in GitHub Desktop.
change_mysql_relay_bin_log_directory.md
  • Change the relay_log variable in the my.cnf to relay_log = /mnt/relay/mysql_relay_bin

  • Stop mysqld

systemctl stop mysqld
  • Move all relay_log to new location:
mv /var/lib/mysql/mysql_relay_bin.* /mnt/relay/
chown mysql:mysql /mnt/relay/ -R
  • Start mysqld
systemctl start mysqld
  • Start slave
mysql -A -e "START SLAVE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment