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
After this changes MySQL server can't start with error:
/usr/sbin/mysqld: File '/home/developer/logs/mysql/mysql-bin.index'
not found (Errcode: 13)
111005 12:47:58 [ERROR] Aborting
Permission for directory /home/developer/logs/mysql/ is 0777
What's going on?
You need to give user permissions to the directory as follows:
Selinux might enforce the rule that MySQL database files have to live in /var/lib/mysql and not anywhere else. Try turning off selinux (selinux=0 on kernel boot command line) if you moved mysql to another directory.
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.
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 was really stuck in the middle of my MySQL Master - Slave setup. Finally the above was a permission issue, adding the below command solved my issue.
During replication configuration in "my.cnf" file needs to mention
server-id=1 log_bin=/var/log/mysql/mysql-bin.log
you can make your own directory and give permission. create directory "mysql" in /var/log/
this is applicable with MySQL version 5.7