MySQL 5.1.54 Ubuntu 11.04
I\'am try to change bin log directory in my.conf as:
[mysqld]
log_bin=/home/developer/logs/mysql/mysql-bin.log
<
Does your user have access to all upper directories? In special, the /home/developer/ directory? Try to log in with the mysql server account and touch the log file.
I had a similar problem when I was trying to change the datadir variable during a fresh install. The solution in my case was to run the first time start up with log-bin disabled. After that I was able to enable it again using the new path ...
You need to give user permissions to the directory as follows:
chown -R mysql:mysql /home/developer/logs/mysql/
As usual, the solution was simple but not obvious: it needed to edit apparmor settings I just added to /etc/apparmor.d/usr.sbin.mysqld a new string with path to target directory: /home/developer/logs/* rw
It works!
You can also comment the line in my.cnf
file which is defining the log location, so mysql will consider its default path and will start properly.
log-bin = /var/log/mysql/mysql-bin.log
-> #log-bin = /var/log/mysql/mysql-bin.log
.
This will be helpful if you are not concerned much about logs.
As documentation in mysql say https://dev.mysql.com/doc/refman/5.7/en/replication-options-binary-log.html#sysvar_log_bin
The variable is log_bin and not log-bin at least in version 5.7