snippetsqlMinor
How to set selinux permission for non-standard mysql bin log path?
Viewed 0 times
pathbinnonlogpermissionselinuxstandardmysqlforhow
Problem
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
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
Solution
To set mysql selinux on a directory you can:
then
Also check the mysql user has permissions on your directory:
Set permissions if needed:
semanage fcontext -a -t mysqld_db_t "/yourdirectory(/.*)?"then
restorecon -Rv /yourdirectoryAlso check the mysql user has permissions on your directory:
ls -lSet permissions if needed:
chown -R mysql:mysql /yourdirectoryContext
StackExchange Database Administrators Q#58768, answer score: 3
Revisions (0)
No revisions yet.