InnoDB: Operating system error number 13 in a file operation.

本文详细记录了一次解决MySQL启动失败的问题,错误代码为13,涉及权限问题。通过查看mysqld.log日志发现InnoDB插件初始化失败,原因是mysqld没有访问目录的权限,最终通过设置SELinux策略解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Mysql安装好之后,启动服务报以下错误:

Starting mysqld (via systemctl):  Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

通过日志可以看到以下错误:

cat /var/log/mysqld.log

2018-11-05T14:56:36.150707Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2018-11-05T14:56:36.150728Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2018-11-05T14:56:36.150734Z 0 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions
2018-11-05T14:56:36.150744Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-11-05T14:56:36.751167Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-11-05T14:56:36.751185Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-11-05T14:56:36.751190Z 0 [ERROR] Failed to initialize builtin plugins.
2018-11-05T14:56:36.751194Z 0 [ERROR] Aborting

解决方案:setenforce 0 

就可以了

转载于:https://my.oschina.net/zchuanzhao/blog/2870239

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值