CentOS 7启动数据库服务失败

说明:记录一次启动数据库失败的异常

场景

powershell 复制代码
systemctl start mysqld

使用systemctl start mysqld命令启动MySQL服务,报下面的错误:

复制代码
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

提示让我使用journalctl -xe命令,查看一下详细,内容如下:

复制代码
4月 10 20:50:22 CentOS79 polkitd[848]: Unregistered Authentication Agent for unix-process:13016:187895386 (system bus name :1.1185, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)
4月 10 20:50:42 CentOS79 polkitd[848]: Registered Authentication Agent for unix-process:13026:187897598 (system bus name :1.1186 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8)
4月 10 20:50:42 CentOS79 systemd[1]: Starting mysqld.service...
-- 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.
4月 10 20:50:45 CentOS79 systemd[1]: mysqld.service: control process exited, code=exited status=1
4月 10 20:50:45 CentOS79 systemd[1]: Failed to start mysqld.service.
-- 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.
4月 10 20:50:45 CentOS79 systemd[1]: Unit mysqld.service entered failed state.
4月 10 20:50:45 CentOS79 systemd[1]: mysqld.service failed.
4月 10 20:50:45 CentOS79 polkitd[848]: Unregistered Authentication Agent for unix-process:13026:187897598 (system bus name :1.1186, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale zh_CN.UTF-8) (disconnected from bus)

毫无头绪,然后我查看了一下MySQL记录的日志信息,如下:

复制代码
2024-04-10T12:50:42.738859Z 0 [Warning] Changed limits: max_open_files: 5000 (requested 7500)
2024-04-10T12:50:42.738955Z 0 [Warning] Changed limits: table_open_cache: 1745 (requested 2048)
2024-04-10T12:50:42.917286Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2024-04-10T12:50:42.917339Z 0 [Note] /data/mysql/bin/mysqld (mysqld 5.7.36-log) starting as process 13032 ...
2024-04-10T12:50:42.922551Z 0 [Note] InnoDB: PUNCH HOLE support available
2024-04-10T12:50:42.922590Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-04-10T12:50:42.922595Z 0 [Note] InnoDB: Uses event mutexes
2024-04-10T12:50:42.922598Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2024-04-10T12:50:42.922602Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-04-10T12:50:42.922606Z 0 [Note] InnoDB: Using Linux native AIO
2024-04-10T12:50:42.923404Z 0 [Note] InnoDB: Number of pools: 1
2024-04-10T12:50:42.923536Z 0 [Note] InnoDB: Using CPU crc32 instructions
2024-04-10T12:50:42.925015Z 0 [Note] InnoDB: Initializing buffer pool, total size = 10G, instances = 8, chunk size = 128M
2024-04-10T12:50:43.486095Z 0 [Note] InnoDB: Completed initialization of buffer pool
2024-04-10T12:50:43.555443Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2024-04-10T12:50:43.567488Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2024-04-10T12:50:43.750980Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-04-10T12:50:43.751049Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-04-10T12:50:43.765705Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2024-04-10T12:50:43.766370Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2024-04-10T12:50:43.766378Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2024-04-10T12:50:43.767368Z 0 [Note] InnoDB: Waiting for purge to start
2024-04-10T12:50:43.817571Z 0 [Note] InnoDB: 5.7.36 started; log sequence number 2750697
2024-04-10T12:50:43.817969Z 0 [Note] InnoDB: Loading buffer pool(s) from /data/mydata/ib_buffer_pool
2024-04-10T12:50:43.818543Z 0 [Note] Plugin 'FEDERATED' is disabled.
2024-04-10T12:50:43.819940Z 0 [Note] InnoDB: Buffer pool(s) load completed at 240410 20:50:43
2024-04-10T12:50:43.824078Z 0 [ERROR] Too many arguments (first extra is 'start').
2024-04-10T12:50:43.824097Z 0 [Note] Use --verbose --help to get a list of available options!
2024-04-10T12:50:43.824103Z 0 [ERROR] Aborting

2024-04-10T12:50:43.824114Z 0 [Note] Binlog end
............
2024-04-10T12:50:45.650620Z 0 [Note] /data/mysql/bin/mysqld: Shutdown complete

有一条ERROR,[ERROR] Too many arguments (first extra is 'start').,于是我查了许多这方面的文章、博客,但都没有用;

解决

使用systemctl start mysql,即去掉最后一个d。我也不太清楚,前面的时候为什么要加上一个d,后面偶然漏敲了,反而可以正常启动。

powershell 复制代码
systemctl start mysql
相关推荐
Yushan Bai1 分钟前
ORACLE DATAGUARD遇到GAP增量恢复方式修复RAC环境备机的实践
数据库·oracle
数巨小码人8 分钟前
Linux常用指令
linux·运维·服务器
●^●14 分钟前
Linux 命令行与 vi/vim 编辑器完全指南
linux·编辑器·vim
哈哈幸运21 分钟前
Linux Awk 深度解析:10个生产级自动化与云原生场景
linux·云原生·自动化·awk·三剑客
Linux运维老纪27 分钟前
Linux之七大难命令(The Seven Difficult Commands of Linux)
linux·运维·服务器·云计算·运维开发
漫谈网络43 分钟前
Ollama工具调用(Tool Calls)业务应用案例
linux·ai·aigc·工具调用·ollama·tool calls
搬砖天才、43 分钟前
日常记录-redis主从复制(master-slave)+ Sentinel 哨兵(高可用)
数据库·redis·sentinel
unique_落尘44 分钟前
java操作打印机直接打印及详细linux部署(只适用于机器和打印机处于同一个网段中)
java·linux·打印机
努力奋斗的小杨1 小时前
学习MySQL的第十一天
数据库·笔记·sql·学习·mysql·navicat
TDengine (老段)1 小时前
TDengine 流计算引擎设计
大数据·数据库·物联网·flink·时序数据库·tdengine·涛思数据