openeuler-24.3欧拉系统mysql开机自启报错

本地部署mysql服务,某天突然停电,导致数据库服务器重启了,然后第二天发现数据服务没有起来,mysql设置开机自启了,还是没有正常启动。登陆上去一看报错信息入下:

root@db-01 \~# systemctl status mysqld

● mysqld.service - MySQL Server

Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)

Active: deactivating (stop-sigterm) (Result: exit-code)

Docs: man:mysqld(8)

http://dev.mysql.com/doc/refman/en/using-systemd.html

Process: 3067450 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)

Process: 3067469 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)

Tasks: 18 (limit: 47381)

Memory: 168.2M

CGroup: /system.slice/mysqld.service

└─ 3067471 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

9月 28 11:48:20 db-01 mysqld3067471: 2025-09-28T03:48:20.927501Z 0 Note Shutting down plugin 'INNODB_CMP'

9月 28 11:48:20 db-01 mysqld3067471: 2025-09-28T03:48:20.927504Z 0 Note Shutting down plugin 'INNODB_LOCK_WAITS'

9月 28 11:48:20 db-01 mysqld3067471: 2025-09-28T03:48:20.927507Z 0 Note Shutting down plugin 'INNODB_LOCKS'

9月 28 11:48:20 db-01 mysqld3067471: 2025-09-28T03:48:20.927510Z 0 Note Shutting down plugin 'INNODB_TRX'

9月 28 11:48:20 db-01 mysqld3067471: 2025-09-28T03:48:20.927512Z 0 Note Shutting down plugin 'InnoDB'

9月 28 11:48:20 db-01 mysqld3067471: 2025-09-28T03:48:20.927627Z 0 Note InnoDB: FTS optimize thread exiting.

9月 28 11:48:20 db-01 mysqld3067471: 2025-09-28T03:48:20.927763Z 0 Note InnoDB: Starting shutdown...

9月 28 11:48:20 db-01 systemd1: mysqld.service: Control process exited, code=exited, status=1/FAILURE

9月 28 11:48:21 db-01 mysqld3067471: 2025-09-28T03:48:21.027960Z 0 Note InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool

9月 28 11:48:21 db-01 mysqld3067471: 2025-09-28T03:48:21.028225Z 0 Note InnoDB: Buffer pool(s) dump completed at 250928 11:48:21

× mysqld.service - MySQL Server

Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)

Active: failed (Result: exit-code) since Sun 2025-09-28 11:50:22 CST; 773ms ago

Docs: man:mysqld(8)

http://dev.mysql.com/doc/refman/en/using-systemd.html

Process: 3081500 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)

Process: 3081519 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)

9月 28 11:50:22 db-01 systemd1: mysqld.service: Scheduled restart job, restart counter is at 3.

9月 28 11:50:22 db-01 systemd1: Stopped MySQL Server.

9月 28 11:50:22 db-01 systemd1: mysqld.service: Start request repeated too quickly.

9月 28 11:50:22 db-01 systemd1: mysqld.service: Failed with result 'exit-code'.

9月 28 11:50:22 db-01 systemd1: Failed to start MySQL Server.

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

9月 28 14:28:00 db-01 mysqld3998858: 2025-09-28T06:28:00.074313Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:28:00 db-01 mysqld3998858: 2025-09-28T06:28:00.074318Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:28:00 db-01 mysqld3998858: 2025-09-28T06:28:00.074355Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.809660Z 0 Note InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822031Z 0 Note InnoDB: Highest supported file format is Barracuda.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822147Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822153Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822158Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822168Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822172Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822176Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822185Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822188Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822192Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822200Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822203Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822207Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822217Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822220Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822224Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822236Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822240Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822243Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822252Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822255Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822258Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822267Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822271Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822274Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822283Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822286Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822289Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822300Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822304Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822307Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822318Z 0 ERROR InnoDB: Operating system error number 13 in a file operation.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822322Z 0 ERROR InnoDB: The error means mysqld does not have the access rights to the directory.

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822325Z 0 ERROR InnoDB: os_file_readdir_next_file() returned -1 in directory ./, crash recovery may have failed for some .ibd files!

9月 28 14:38:29 db-01 mysqld4059521: 2025-09-28T06:38:29.822336Z 0 ERROR InnoDB: Plugin initialization aborted with error Generic error

9月 28 14:38:30 db-01 mysqld4059521: 2025-09-28T06:38:30.423007Z 0 ERROR Plugin 'InnoDB' init function returned error.

9月 28 14:38:30 db-01 mysqld4059521: 2025-09-28T06:38:30.423057Z 0 ERROR Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

9月 28 14:38:30 db-01 mysqld4059521: 2025-09-28T06:38:30.423068Z 0 ERROR Failed to initialize builtin plugins.

9月 28 14:38:30 db-01 mysqld4059521: 2025-09-28T06:38:30.423074Z 0 ERROR Aborting

9月 28 14:38:30 db-01 mysqld4059521: 2025-09-28T06:38:30.423135Z 0 Note Binlog end

9月 28 14:38:30 db-01 mysqld4059519: Initialization of mysqld failed: 0

9月 28 14:38:30 db-01 mysqld4059521: 2025-09-28T06:38:30.423233Z 0 Note Shutting down plugin 'CSV'

9月 28 14:38:30 db-01 mysqld4059521: 2025-09-28T06:38:30.423574Z 0 Note /usr/sbin/mysqld: Shutdown complete

9月 28 14:38:30 db-01 systemd1: mysqld.service: Control process exited, code=exited, status=1/FAILURE

9月 28 14:38:30 db-01 systemd1: mysqld.service: Failed with result 'exit-code'.

9月 28 14:38:30 db-01 systemd1: Failed to start MySQL Server.

9月 28 14:38:30 db-01 systemd1: mysqld.service: Scheduled restart job, restart counter is at 5.

9月 28 14:38:30 db-01 systemd1: Stopped MySQL Server.

9月 28 14:38:30 db-01 systemd1: mysqld.service: Start request repeated too quickly.

9月 28 14:38:30 db-01 systemd1: mysqld.service: Failed with result 'exit-code'.

9月 28 14:38:30 db-01 systemd1: Failed to start MySQL Server.

经过排查没有问题,也不是目录损坏,都正常之后,mysql服务还是不能启动。然后突然想到防火墙查看防火墙也是正常的。然后想到欧拉系统的selinux服务需要手动设置成disabled。才能正常启动,于是把seliunx设置成disabled,之前部署时临时设置成0了,所以导致服务器重启后,mysql服务设置开机自启也没有启动起来。临时关闭一下seliunx服务(setenforce 0)再重启一下mysql服务就正常了。

#设置seliunx

bash 复制代码
setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
相关推荐
kebidaixu5 小时前
BCU 平台 RS485 驱动适配:从 THVD1406 到 ISO3082
linux
北顾笙9806 小时前
MySQL-day2
数据库·mysql
谢平康7 小时前
解决用 rm 报bash: /usr/bin/rm: Argument list too long错
linux·运维·运维开发
程序猿乐锅7 小时前
【MySQL | 第八篇】MySQL 视图
数据库·mysql
hj2862519 小时前
Linux 网络服务综合笔记(概念 + 命令 + 实操案例)2
linux·运维·网络
what_20189 小时前
Linux 磁盘 (查看、划分、inode)
linux·运维·服务器
2739920299 小时前
GDB调试(Linux)
linux
凡人叶枫9 小时前
Effective C++ 条款23:宁以 non-member、non-friend 替换 member 函数
linux·开发语言·c++·嵌入式开发
不会C语言的男孩10 小时前
Linux 系统编程 · 第 4 章:文件属性与元数据
linux·c语言·开发语言
小生不才yz10 小时前
Shell脚本精读 · S02-03 | 词拆分、通配符与未加引号的变量
linux