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.
Table of Contents
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%';
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.
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
4. Now validate the Location and you will be able to see that binlog location has been changed.
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.
Pingback: How to check Audit logs in MySQL :