【解决吧】Job for mariadb.service failed because the control process exited with error code.

一、问题描述


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

二、排查过程


systemctl status mariadb.service 执行信息

[root@proxy nginx]# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2025-05-18 15:57:35 CST; 12s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 5341 ExecStart=/usr/libexec/mysqld --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER (code=exited, status=1/FAILURE)
  Process: 5302 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
  Process: 5278 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 5341 (code=exited, status=1/FAILURE)

从该信息中仅确认 ExecStart=/usr/libexec/mysqld --basedir=/usr $MYSQLD_OPTS $_WSREP_NEW_CLUSTER (code=exited, status=1/FAILURE)的执行是失败的(进程错误)。仍无法确认具体。

/var/log/mariadb/mariadb.log 日志记录

[root@proxy mariadb]# vi mariadb.log
...
2025-05-18 15:59:34 0 [Warning] mysqld: GSSAPI plugin : default principal 'mariadb/proxy@' not found in keytab
2025-05-18 15:59:34 0 [ERROR] mysqld: Server GSSAPI error (major 851968, minor 2529639093) : gss_acquire_cred failed -Unspecified GSS failure.  Minor code may provide more information. Keytab FILE:/etc/krb5.keytab is nonexistent or empty.
2025-05-18 15:59:34 0 [ERROR] Plugin 'gssapi' init function returned error.
2025-05-18 15:59:34 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded 
...
2025-05-18 15:59:34 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
...
2025-05-18 15:59:34 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
...
2025-05-18 16:00:41 0 [Warning] mysqld: GSSAPI plugin : default principal 'mariadb/proxy@' not found in keytab
2025-05-18 16:00:41 0 [ERROR] mysqld: Server GSSAPI error (major 851968, minor 2529639093) : gss_acquire_cred failed -Unspecified GSS failure.  Minor code may provide more information. Keytab FILE:/etc/krb5.keytab is nonexistent or empty.
2025-05-18 16:00:41 0 [ERROR] Plugin 'gssapi' init function returned error.
2025-05-18 16:00:41 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
...
2025-05-18 16:00:41 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
...
2025-05-18 16:00:41 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

日志提出 GSSAPI 初始化错误,以及相关 plugin/tables/users 缺失。即使在 重装过程中,mariadb/mariadb-server/mariadb-devel 的启用问题仍然存在。

三、解决方法 | /var/lib 缓存清理


[root@proxy ~]# yum remove mariadb mariadb-server mariadb-devel         # 卸载操作优先执行
[root@proxy ~]# rm -rf /var/lib/mysql                                   # 删除缓存
...

[root@proxy ~]# yum -y install mariadb mariadb-server mariadb-devel     # 重装模块
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值