selinux开启导致MySQL启动报错 Permission denied
Tags: MySQLPermission deniedSELinux故障处理
背景
OS:centos 7.9
MySQL:5.7
首次使用某海外云,申请云主机自建 MySQL ,service mysqld start 启动报错
1 2 3 | Job for mysqld.service failed because the control process exited with err or code. See "systemctl status mysqld.service" and "journalctl ‐xe" for det ails. |
诊断
journalctl -xe 查看详细日志。
1 2 3 4 5 6 7 8 9 10 11 12 | Oct 09 06:57:42 mysqld[30507]: 2022‐10‐09T06:57:42.953987Z 0 [Warning] Ca n't create test file /data/var/.lower‐test Oct 09 06:57:42 mysqld[30507]: 2022‐10‐09T06:57:42.954069Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.34‐log) starting as process 30510 ... Oct 09 06:57:42 mysqld[30507]: 2022‐10‐09T06:57:42.956924Z 0 [Warning] Ca n't create test file /data/var/.lower‐test Oct 09 06:57:42 mysqld[30507]: 2022‐10‐09T06:57:42.956958Z 0 [Warning] Ca n't create test file /data/var/.lower‐test Oct 09 06:57:42 mysqld[30507]: 2022‐10‐09T06:57:42.957892Z 0 [ERROR] Coul d not open file './err.log' for error logging: Permission denied Oct 09 06:57:42 mysqld[30507]: 2022‐10‐09T06:57:42.957954Z 0 [ERROR] Abor ting |