How to Change Binary Log Location in MySQL:

Do you know how to change Binary Log Location in MySQL? So today in this article, we will learn about this. In our previous article, we have already seen how to enable/disable Binary Logs in MySQL. Now let’s go through the steps.

1. By default, the Binlogs will be present in the Data Directory. You can find it through the following command :
show variables like '%log_bin%';
Location of the Binary Logs in MySQL
2. Now, if we want to change the location, then edit my.cnf file put the desired location with the name as below, and save it.
Change Binary log Location in MySQL
3. Then change the permission as chown mysql:mysql binlog and restart the mysqld services.
  • chown mysql:mysql binlog
  • systemctl stop mysqld
  • systemctl start mysqld
How to Change Binary Log Location in MySQL:
4. Now validate the Location and you will be able to see that binlog location has been changed.
How to Change Binary Log Location in MySQL:

So here is a short and simple steps to understand how to change Binary Log Location in MySQL. Hope this Helps!! For further reference, you can also check out MySQL Doc for another utility.

This Post Has One Comment

Leave a Reply