当前位置: 首页 > news >正文

Mysql报错:跳至内容辅助功能反馈[ERROR] InnoDB: Operating system error number 13 in a file operation.的解决方法

启动mysql报错:

代码语言:javascript

AI代码解释

[root@localhost ~]# systemctl start mysqld Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

以下三种查看报错信息方式:

1. systemctl status mysqld.service

代码语言:javascript

AI代码解释

[root@localhost ~]# systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: failed (Result: start-limit) since 六 2020-03-14 03:55:06 CST; 14s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 73992 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE) Process: 73975 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 72217 (code=exited, status=0/SUCCESS) 3月 14 03:55:06 localhost.localdomain systemd[1]: Failed to start MySQL Server. 3月 14 03:55:06 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state. 3月 14 03:55:06 localhost.localdomain systemd[1]: mysqld.service failed. 3月 14 03:55:06 localhost.localdomain systemd[1]: mysqld.service holdoff time over, scheduling restart. 3月 14 03:55:06 localhost.localdomain systemd[1]: Stopped MySQL Server. 3月 14 03:55:06 localhost.localdomain systemd[1]: start request repeated too quickly for mysqld.service 3月 14 03:55:06 localhost.localdomain systemd[1]: Failed to start MySQL Server. 3月 14 03:55:06 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state. 3月 14 03:55:06 localhost.localdomain systemd[1]: mysqld.service failed.

2. journalctl -xe

代码语言:javascript

AI代码解释

[root@localhost ~]# journalctl -xe -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has failed. -- -- The result is failed. 3月 14 03:55:04 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state. 3月 14 03:55:04 localhost.localdomain systemd[1]: mysqld.service failed. 3月 14 03:55:05 localhost.localdomain systemd[1]: mysqld.service holdoff time over, scheduling restart. 3月 14 03:55:05 localhost.localdomain systemd[1]: Stopped MySQL Server. -- Subject: Unit mysqld.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has finished shutting down. 3月 14 03:55:05 localhost.localdomain systemd[1]: Starting MySQL Server... -- Subject: Unit mysqld.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has begun starting up. 3月 14 03:55:06 localhost.localdomain mysqld[73992]: Initialization of mysqld failed: 0 3月 14 03:55:06 localhost.localdomain systemd[1]: mysqld.service: control process exited, code=exited status=1 3月 14 03:55:06 localhost.localdomain systemd[1]: Failed to start MySQL Server. -- Subject: Unit mysqld.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has failed. -- -- The result is failed. 3月 14 03:55:06 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state. 3月 14 03:55:06 localhost.localdomain systemd[1]: mysqld.service failed. 3月 14 03:55:06 localhost.localdomain systemd[1]: mysqld.service holdoff time over, scheduling restart. 3月 14 03:55:06 localhost.localdomain systemd[1]: Stopped MySQL Server. -- Subject: Unit mysqld.service has finished shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has finished shutting down. 3月 14 03:55:06 localhost.localdomain systemd[1]: start request repeated too quickly for mysqld.service 3月 14 03:55:06 localhost.localdomain systemd[1]: Failed to start MySQL Server. -- Subject: Unit mysqld.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit mysqld.service has failed. -- -- The result is failed. 3月 14 03:55:06 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state. 3月 14 03:55:06 localhost.localdomain systemd[1]: mysqld.service failed.

3.查看日志(推荐):

代码语言:javascript

AI代码解释

[root@localhost ~]# cat /var/log/mysqld.log ... 2020-03-13T18:53:16.099273Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation. 2020-03-13T18:53:16.099347Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory. 2020-03-13T18:53:16.099357Z 0 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions 2020-03-13T18:53:16.099369Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2020-03-13T18:53:16.718886Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2020-03-13T18:53:16.718953Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2020-03-13T18:53:16.718962Z 0 [ERROR] Failed to initialize builtin plugins. 2020-03-13T18:53:16.718966Z 0 [ERROR] Aborting

排错:

查看日志后可以看到日志中的ERROR信息,不懂的地方可以翻译一下,方便理解,寻找有用的信息。

代码语言:javascript

AI代码解释

[ERROR] InnoDB: Operating system error number 13 in a file operation. [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory. [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions [ERROR] InnoDB: Plugin initialization aborted with error Generic error [ERROR] Plugin 'InnoDB' init function returned error. [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. [ERROR] Failed to initialize builtin plugins. [ERROR] Aborting ↓↓↓↓↓↓ [错误] InnoDB:文件操作中的操作系统错误号13。 [错误] InnoDB:该错误意味着mysqld没有访问该目录的权限。 [错误] InnoDB: os_file_get_status()在上失败。/ibdata1。无法确定文件权限 [错误] InnoDB:插件初始化中止,出现错误一般错误 [错误]插件“InnoDB”初始化函数返回错误。 [错误]插件“InnoDB”注册为存储引擎失败。 [错误]初始化内置插件失败。 [错误]中止

解决方案:

代码语言:javascript

AI代码解释

[root@localhost ~]# getenforce //查看selinux状态 Enforcing [root@localhost ~]# setenforce 0 //临时关闭selinux,重启后失效 [root@localhost ~]# getenforce Permissive [root@localhost ~]# systemctl start mysqld //启动mysql服务成功 [root@localhost ~]# ss -antulp | grep :3306 tcp LISTEN 0 80 [::]:3306 [::]:* users:(("mysqld",pid=74057,fd=17))

永久关闭selinux

代码语言:javascript

AI代码解释

[root@localhost ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted

备份配置文件

代码语言:javascript

AI代码解释

[root@localhost ~]# cp -r /etc/selinux/config /etc/selinux/config.bak [root@localhost ~]# sed -i 's/SELINUX=enforcing/\SELINUX=disabled/' /etc/selinux/config [root@localhost ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
http://www.jsqmd.com/news/955587/

相关文章:

  • 基于TensorFlow的YOLO目标检测环境搭建与实战部署指南
  • MuleSoft企业级LLM编排实践:安全、可观测、可治理的AI服务化
  • 去离子水选哪家?认识一下西南本土企业贵州巧源水处理 - 深度智识库
  • 2026年洛阳酒店茶桌采购要点:从源头工厂直营到高端茶空间定制的核心选型框架 - 精选优质企业推荐官
  • Waveform数据集KMeans聚类实战包:无噪声基准与20%高斯噪声鲁棒性对比
  • 口碑为王!无锡昱邦安为何成为锂电池充电柜口碑标杆? - 品牌推荐大师
  • FPGA时序分析实战:从TimeQuest波形图到SDC约束的完整指南
  • 3分钟掌握电子课本下载神器:智慧教育平台资源获取终极指南
  • 【Excel提效 No.096】一句话搞定银行卡号提取,自动校验避免错误
  • LED背光电视供应链格局解析:技术壁垒与国产替代机遇
  • Android屏幕适配终极解决方案:深入解析AutoSize框架架构设计与实战应用
  • 2026 南京名表回收 TOP6 排行,深耕本地数十年表行报价更贴合行情 - 薛定谔的梨花猫
  • 2026年阿里企业邮箱如何购买?联系电话及开通流程详解 - 品牌2026
  • 直接用的商务风公众号排版模板推荐:公司工作计划模板 - 一串葡萄
  • OMAP3530异构多核开发环境搭建:从工具链配置到DSP/ARM协同实战
  • 【Java毕设源码分享】基于SpringBoot的智能餐饮管理系统的设计与实现(程序+文档+代码讲解+一条龙定制)
  • 不知道怎么选合适的全自动咖啡机,国产专业商用全自动咖啡机值得关注 - 品牌2026
  • 基于手机桥接与4G网络的无人机超视距控制方案设计与实现
  • 从KVM到VMware内核:深入聊聊PVE/unRaid与ESXi在CPU虚拟化性能损耗上的那点事儿
  • 如何利用ExDark数据集解决低光照视觉问题的实战指南
  • 2026年洛阳酒店茶桌采购全攻略:从工厂直营到茶空间美学一站式解决方案 - 精选优质企业推荐官
  • 慕课助手终极指南:如何让你的在线学习效率提升300%
  • 大连出手黄金不用瞎比价,实用变现步骤帮你规避回收各类陷阱 - 奢侈品回收评测
  • 【Java毕设源码分享】基于springboot的共享自行车共享单车管理系统(程序+文档+代码讲解+一条龙定制)
  • 校园志愿者服务全流程管理系统:Spring Boot+Redis签到+多角色权限+时长自动统计
  • MATLAB图像像素级分割工具集:CNN/SAE/DBN等五种网络一键训练与测试
  • 2026年洛阳原木大板选购守则:从源头工厂直营到高端茶空间定制 - 精选优质企业推荐官
  • 深入拆解大模型Token黑洞:为什么 AI Agent 时代我们需要从 FinOps 转向 FinAPI 治理范式?
  • Windows下GTK开发环境配置:从Dev-C++到跨平台GUI编程实战
  • 3PEAK思瑞浦 TP2302-SR SOP8 精密运放