zoukankan      html  css  js  c++  java
  • mysql启动失败“MySQL Daemon failed to start”

    CentOS上,用命令:service mysqld restart 启动mysql报错:

    # service mysqld restart
    Stopping mysqld:                                           [  OK  ]
    MySQL Daemon failed to start.
    Starting mysqld:                                           [FAILED]

    进入mysql相关目录查看:

    # cd /var/lib/mysql/
    # ls 
    hhw_global  ibdata1  ib_logfile0  ib_logfile1  localhost.localdomain.err  mysql  mysql.sock  test

    查看服务器启动日志:

    # tail localhost.localdomain.err 
    190610 20:16:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    190610 20:16:57 [ERROR] You need to use --log-bin to make --binlog-format work.
    190610 20:16:57 [ERROR] Aborting
    
    190610 20:16:57 [Note] /usr/libexec/mysqld: Shutdown complete
    
    190610 20:16:57 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

    可用看到,两行报错说的是,开了--binlog-format选项却没有开启bin log,因此mysql进程开不起来。使用如下命令,查看一下配置的位置:

    # mysqld --verbose --help|grep -A 1 'Default options'

    或者是:

    # mysql --verbose --help|grep -A 1 'Default options'

    查询结果:

    # mysql --verbose --help|grep -A 1 'Default options'
    Default options are read from the following files in the given order:
    /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf 

    找到相应的my.cnf,修改相应配置项,重启mysqld服务即可。

  • 相关阅读:
    mysq foreign外键记录
    查询时隐藏部分身份证号
    SpringBoot接收前端参数
    RabbbitMQ安装
    @configurationProperties注解时 idea弹出 Spring Boot Annotion processor not found in classpath
    rpm,yum和apt使用详解
    python人脸识别
    Fuchsia文章汇总
    Androi O Automotive 介绍
    Linux 版本控制工具之rabbitvcs
  • 原文地址:https://www.cnblogs.com/minglee/p/11000022.html
Copyright © 2011-2022 走看看