Mysql/系统运维

记录一次mysql启动报错mysqld: File ‘./binlog.index‘ not found (OS errno 13 – Permission denied)

daimafengzi · 4月24日 · 2024年本文共499个字 · 预计阅读2分钟10次已读

记录一次mysql启动报错mysqld: File ‘./binlog.index‘ not found (OS errno 13 - Permission denied)

查看日志,查看报错问题

[root@localhost ~]# tail -n50 /var/log/mysqld.log

记录一次mysql启动报错mysqld: File ‘./binlog.index‘ not found (OS errno 13 - Permission denied)

发现是权限问题

      解决方法1:

datadir目录赋予mysql权限

# 查看datadir
[root@localhost ~]# grep 'datadir' /etc/my.cnf
datadir=/data/mysql
[root@localhost ~]# chown -R mysql:mysql /data/mysql
      解决方法2:

关闭selinux

# 临时生效
[root@localhost ~]# setenforce 0
# 永久生效,需要重启系统
[root@localhost ~]# sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config
[root@localhost ~]# reboot

再次重启mysql成功

[root@localhost ~]# systemctl start mysqld

记录一次mysql启动报错mysqld: File ‘./binlog.index‘ not found (OS errno 13 - Permission denied)

0 条回应