Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

By default, mysql bin log works in folder /var/log/mysql. but moving to any other share such /mylogs/mysql gives permission error.

Below is the exact message:

usr/sbin/mysqld: File '/mylogs/mysql/mysql-bin.index' not found (Errcode: 13 - Permission denied)

how to fix this without disabling selinux?

There is similar problem in the link below but solution is not acceptable as I cannot disable SELinux. mysql bin-log.index not found

share|improve this question

To set mysql selinux on a directory you can:

semanage fcontext -a -t mysqld_db_t "/yourdirectory(/.*)?"


restorecon -Rv /yourdirectory

Also check the mysql user has permissions on your directory:

ls -l

Set permissions if needed:

chown -R mysql:mysql /yourdirectory

share|improve this answer
question if you dont mind. Something like mean the result will not fix the issue for sure or not sure about the syntax. – Ahmad Abuhasna Mar 24 at 15:53
Well this is how I would try add the mysql policy to selinux. so mysql has permissions to do filesystem operations. something to try, shouldn't do any harm – cormpadre Mar 25 at 18:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.