安装成功后无法启动 Mariadb

安装成功后无法启动 Mariadb

我使用的是 CentOS 6.8,想安装 mariadb 5.5。我按照以下所有步骤操作https://mariadb.com/kb/en/mariadb/yum/

vi /etc/yum.repos.d/MariaDB.repo

然后插入

# MariaDB 5.5 CentOS repository list - created 2017-01-05 04:37 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

然后运行

sudo yum install MariaDB-server MariaDB-client

安装成功后,我想启动数据库

/etc/init.d/mysql start

不幸的是这个错误正在发生:

Starting MySQL.170105 08:42:42 mysqld_safe Logging to '/var/lib/mysql/test.mcc.edu.om.err'.
170105 08:42:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/bin/mysqld_safe_helper: Can't create/write to file '' (Errcode: -328342880)
 ERROR!

/var/log/ 中没有日志

有人可以指导我可能是什么问题吗?

我还尝试将 -R mysql:mysql chown 到 /var/lib 或 /usr/lib 或 /usr/share 中与 mysql 相关的所有目录,但没有成功,

请问有什么建议吗?

按照要求@Koen van der Rijt

这是运行 /etc/init.d/mysql start 后 /var/log/audit/audit.log 的输出

type=USER_CMD msg=audit(1483602976.169:249): user pid=9358 uid=0 auid=0 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='cwd="/" cmd=2F6574632F696E69742E642F6D7973716C207374617274 terminal=pts/0 res=success'
type=CRED_ACQ msg=audit(1483602976.169:250): user pid=9358 uid=0 auid=0 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
type=USER_START msg=audit(1483602976.169:251): user pid=9358 uid=0 auid=0 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
type=AVC msg=audit(1483602976.350:252): avc:  denied  { setgid } for  pid=9450 comm="mysqld_safe_hel" capability=6  scontext=unconfined_u:system_r:mysqld_safe_t:s0 tcontext=unconfined_u:system_r:mysqld_safe_t:s0 tclass=capability
type=SYSCALL msg=audit(1483602976.350:252): arch=c000003e syscall=116 success=no exit=-1 a0=1 a1=11de600 a2=10000 a3=1 items=0 ppid=9365 pid=9450 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm="mysqld_safe_hel" exe="/usr/bin/mysqld_safe_helper" subj=unconfined_u:system_r:mysqld_safe_t:s0 key=(null)
type=AVC msg=audit(1483602976.350:253): avc:  denied  { setgid } for  pid=9450 comm="mysqld_safe_hel" capability=6  scontext=unconfined_u:system_r:mysqld_safe_t:s0 tcontext=unconfined_u:system_r:mysqld_safe_t:s0 tclass=capability
type=SYSCALL msg=audit(1483602976.350:253): arch=c000003e syscall=106 success=no exit=-1 a0=1f3 a1=1f3 a2=ca a3=7ffef20f7170 items=0 ppid=9365 pid=9450 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm="mysqld_safe_hel" exe="/usr/bin/mysqld_safe_helper" subj=unconfined_u:system_r:mysqld_safe_t:s0 key=(null)
type=AVC msg=audit(1483602976.371:254): avc:  denied  { setgid } for  pid=9461 comm="mysqld_safe_hel" capability=6  scontext=unconfined_u:system_r:mysqld_safe_t:s0 tcontext=unconfined_u:system_r:mysqld_safe_t:s0 tclass=capability
type=SYSCALL msg=audit(1483602976.371:254): arch=c000003e syscall=116 success=no exit=-1 a0=1 a1=2818600 a2=10000 a3=1 items=0 ppid=9365 pid=9461 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm="mysqld_safe_hel" exe="/usr/bin/mysqld_safe_helper" subj=unconfined_u:system_r:mysqld_safe_t:s0 key=(null)
type=AVC msg=audit(1483602976.372:255): avc:  denied  { setgid } for  pid=9461 comm="mysqld_safe_hel" capability=6  scontext=unconfined_u:system_r:mysqld_safe_t:s0 tcontext=unconfined_u:system_r:mysqld_safe_t:s0 tclass=capability
type=SYSCALL msg=audit(1483602976.372:255): arch=c000003e syscall=106 success=no exit=-1 a0=1f3 a1=1f3 a2=ca a3=7ffeeb737ad0 items=0 ppid=9365 pid=9461 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm="mysqld_safe_hel" exe="/usr/bin/mysqld_safe_helper" subj=unconfined_u:system_r:mysqld_safe_t:s0 key=(null)
type=AVC msg=audit(1483602976.394:256): avc:  denied  { setgid } for  pid=9467 comm="mysqld_safe_hel" capability=6  scontext=unconfined_u:system_r:mysqld_safe_t:s0 tcontext=unconfined_u:system_r:mysqld_safe_t:s0 tclass=capability
type=SYSCALL msg=audit(1483602976.394:256): arch=c000003e syscall=116 success=no exit=-1 a0=1 a1=ee0600 a2=10000 a3=1 items=0 ppid=9365 pid=9467 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm="mysqld_safe_hel" exe="/usr/bin/mysqld_safe_helper" subj=unconfined_u:system_r:mysqld_safe_t:s0 key=(null)
type=AVC msg=audit(1483602976.394:257): avc:  denied  { setgid } for  pid=9467 comm="mysqld_safe_hel" capability=6  scontext=unconfined_u:system_r:mysqld_safe_t:s0 tcontext=unconfined_u:system_r:mysqld_safe_t:s0 tclass=capability
type=SYSCALL msg=audit(1483602976.394:257): arch=c000003e syscall=106 success=no exit=-1 a0=1f3 a1=1f3 a2=ca a3=7ffc7f986aa0 items=0 ppid=9365 pid=9467 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=2 comm="mysqld_safe_hel" exe="/usr/bin/mysqld_safe_helper" subj=unconfined_u:system_r:mysqld_safe_t:s0 key=(null)
type=USER_END msg=audit(1483602977.229:258): user pid=9358 uid=0 auid=0 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'
type=CRED_DISP msg=audit(1483602977.229:259): user pid=9358 uid=0 auid=0 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=success'

禁用 SeLinux 后问题就解决了!谢谢 https://serverfault.com/users/200850/koen-van-der-rijt

答案1

禁用 SeLinux 后问题就解决了!谢谢 https://serverfault.com/users/200850/koen-van-der-rijt

相关内容