zoukankan      html  css  js  c++  java
  • MySQL Plugin 'InnoDB' init function returned error一例

    早上上班后,测试说演示环境挂了,维护上去看了下,启动报错了:

    XXXXXX08:30:47 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    XXXXXX08:30:50 [Warning] The syntax '--log-slow-queries' is deprecated and will be removed in a future release. Please use '--slow-query-log'/'--slow-query-log-file' instead.
    XXXXXX08:30:50 [Note] Plugin 'FEDERATED' is disabled.
    XXXXXX08:30:51 InnoDB: The InnoDB memory heap is disabled
    XXXXXX08:30:51 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
    XXXXXX08:30:51 InnoDB: Compressed tables use zlib 1.2.3
    XXXXXX08:30:51 InnoDB: Using Linux native AIO
    XXXXXX08:30:51 InnoDB: Initializing buffer pool, size = 16.0M
    XXXXXX08:30:51 InnoDB: Completed initialization of buffer pool
    InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
    InnoDB: than specified in the .cnf file 0 104857600 bytes!
    XXXXXX08:30:51 [ERROR] Plugin 'InnoDB' init function returned error.
    XXXXXX08:30:51 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    XXXXXX08:30:51 [ERROR] Unknown/unsupported storage engine: InnoDB
    XXXXXX08:30:51 [ERROR] Aborting

    网上的说法是“没有正常关闭mysqld服务的情况下,对数据库参数进行改变导致的。因此重启后的服务器不支持InnoDB引擎。

    解决方法是:删除MySQL目录下的ib_logfile0和ib_logfile1两个文件”。

    其实这有个条件,就是block没有损坏,如果有block损坏了,这样还是无法启动的。

    还有个帖子说的是删除mysql目录下的data中所有文件,这不等于完全初始化么?这要是DEMO库就算了,要是线上库、用了几个月的开发、测试库,那重新初始化的成本也太高昂了,况且老板也不允许这么个搞法。

    没辙,只能先用innodb_force_recovery=1启动,把数据备份出来,再还原了。

    启动后,mysqldump时发现一张表的PK有问题了,没发整个dump出来,是张归档表,直接drop了,其他到问题不大,都出来了。

    最后删除所有mysql db数据,重新执行mysql_install_db初始化,最后source alldb.sql还原。

    还是得规规矩矩启动和停止,kill db真心有风险。

    发现大部分的公司存在的一种现象就是备份嫌烦、standby也嫌烦,然后就宕机了,block损坏了。一拨人干等着一个库。

    早上shutdown不掉,kill了下mysqld,导致出现了下僵尸defunct进程,幸亏Kill ps -ef | grep defunct_process_pid父进程成功杀掉了。

  • 相关阅读:
    解决javaScript在不同时区new Date()显示值不同问题
    页面返回上一页浏览位置
    如何disabled禁用所有表单input输入框元素
    js根据json数组多个字段排序
    No identifier specified for entity
    Android resource compilation failed
    android 系统dialog的应用
    android消息处理源码分析
    Linux下常用命令
    ContentProvider和ContentResolver的使用
  • 原文地址:https://www.cnblogs.com/zhjh256/p/5763631.html
Copyright © 2011-2022 走看看