mysql服务启动失败 [MY-010091] mysqld: File /binlog.index not found selinux

启动mysql服务失败,提示:

[root@localhost ~]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)
2020-06-22T03:05:07.975321Z 0 [Warning] [MY-010091] [Server] Can't create test file /u01/mysql/data/mysqld_tmp_file_case_insensitive_test.lower-test
2020-06-22T03:05:07.975479Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 46140
2020-06-22T03:05:07.980755Z 0 [Warning] [MY-010091] [Server] Can't create test file /u01/mysql/data/mysqld_tmp_file_case_insensitive_test.lower-test
2020-06-22T03:05:07.980777Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /u01/mysql/data/ is case insensitive
2020-06-22T03:05:07.982232Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-06-22T03:05:07.982448Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19)  MySQL Community Server - GPL.
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

仔细一查,原来是selinux惹的祸:

[root@localhost ~]# /usr/sbin/sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      31
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive

改了就行了,要想永久生效还的:vi /etc/sysconfig/selinux。

你可能感兴趣的:(#,MySQL,8,OCP备考笔记,MySQL,mysql)