Error - enabling bin log in mysql I have a mysql server with 5.5. I tried to enable the binlog using the below config file.

# BINARY LOGGING #
server_id                      = 1
log_bin                        = /mysql/binlog/mysql_bin
expire_logs_days               = 14
sync_binlog                    = 1
max_binlog_size                = 100M


/mysql/binlog/ is owned by mysql:mysql

After restart mysql I got the below error.

mysqld: File '/mysql/binlog/mysql-bin.index' not found (Errcode: 13)


So I tried this command.

added this to my.cnf

binlog_do_db                   = mydb    
log_bin_index                  = /mysql/binlog/mysql-bin.index


And executed this commands.

touch /mysql/binlog/mysql-bin.index
chown mysql:mysql /mysql/binlog/mysql-bin.index


But still its throwing the same error.
Please never mind, I found a solution on this blog.

Still the mysql data directory points to /var/lib/mysql

https://schworak.com/blog/e53/move-mysql-binlog-to-another-disk-or-folder/

Then did chmod 700 binlog.