问题描述:
解决办法:
1、目录权限不够,修改成777权限
shell>chmod 777 XXXX
2、关闭防火墙selinux
shell>vi /etc/selinux/config
修改SELINUX=disabled关闭selinux就可以了,这个问题就可以解决了。
不过全部关闭SELINUX有带来一些安全问题。
# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - No SELinux policy is loaded.#SELINUX=enforcingSELINUX=disabled# SELINUXTYPE= can take one of these two values:# targeted - Targeted processes are protected,# mls - Multi Level Security protection.SELINUXTYPE=targeted
3、单独给mysql的守护进程权限
shell>getsebool -a可以查看当前的对系统一系列守护进程的权限情况。
lpd_disable_trans --> offmail_read_content --> offmailman_mail_disable_trans --> offmdadm_disable_trans --> offmozilla_read_content --> offmysqld_disable_trans --> offnagios_disable_trans --> offnamed_disable_trans --> offnamed_write_master_zones --> offnfs_export_all_ro --> onnfs_export_all_rw --> onnfsd_disable_trans --> offnmbd_disable_trans --> offnrpe_disable_trans --> off
/*root用户下执行,-P表示 是永久性设置*/
shell>setsebool -P mysqld_disable_trans=1
在ubuntu下 ,可以对AppArmor(/etc/apparmor.d/usr.sbin.mysqld) 修改,类似selinux。