mariadb启动时报错Job for mariadb.service failed because the control process exited with error code.

arm架构 centos mariadb启动时报错Job for mariadb.service failed because the control process exited with error code.

mariadb作为mysql的一个分支 其安装方式和mysql还有不同 但是具体启动原理还都大同小异

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

安装在鲲鹏服务器(arm架构)的mysql突然挂掉 以为是配置文件的问题 所以在修改my.ini文件进行重新启动 但是在执行systemctl start mysql命令时就会出现这个问题。

  1. 这个报错其实时不能看出具体错误 只是提示你启动失败 但是启动失败在安装没问题的情况下一般就是配置文件的问题。

  2. 由于systemctl start mysql这种启动方式属于全局启动方式 所以在/var/log/mariadb/mariadb.log日志下是没有具体的报错信息的(mariadb.log在etc下的my.ini或者在my.cnf.d文件夹下有默认配置 我的这个配置在/etc/my.cnf.d/mariadb-server.cnf里边 在我的服务器上是这么的 也可能是我的全局启动配置出了问题 也没深究)

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    log-error=/var/log/mariadb/mariadb.log
    pid-file=/run/mariadb/mariadb.pid
    
  3. 这种问题看不到日志的情况下 就可以使用mysql启动程序来进行启动

  4. 查找程序启动的位置

    [root@ecs-6ab1 bin]# find /usr /home -name mysqld_safe
    /usr/bin/mysqld_safe
    
  5. 找到位置后就可以用mysqld_safe进行启动

    ./mysqld_safe  --user=root --basedir=/var/lib/mysql  --datadir=/var/lib/mysql &
    

    具体可以参考(https://www.cnblogs.com/xuey/p/10460495.html)我应该也是这里边介绍的问题 在重启之后sock丢失 导致启动失败

  6. 启动之后就每次查看日志 一步步解决问题
    查看日志 看有没有error

  7. 直至日志中没有错误 用命令行进行连接

    [root@ecs-6ab1 ~]# mysql -u root -p
    Enter password: 
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 10
    Server version: 10.3.28-MariaDB-log MariaDB Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> 
    

    成功!!!

具体的my.ini配置可以参考(https://segmentfault.com/a/1190000021408999

  • 9
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值