【问题标题】:Can't restart MySQL caused by InnoDBInnoDB导致无法重启MySQL
【发布时间】:2019-10-03 05:52:23
【问题描述】:

我无法重新启动 MySQL 或从(InnoDB 表)恢复 MySQL

  • 我有一个使用 Ubuntu 16.04 的 WSL。由于“未知”的意外,早上我无法访问 MySQL。试图重新启动它并......所有错误。 尝试了有关 InnoDB 和 log* 文件的所有建议。但不是成功。 我备份了 /var/lib/mysql 并重新安装了 WSL 的新实例 - Ubuntu 16.04

  • 尝试从物理备份文件(日志* & 数据文件 & 数据库目录)中恢复。但仍然有同样的错误。

[更新 1]

按照本指南:https://dba.stackexchange.com/questions/71596/restoring-mysql-tables-from-ibd-frm-and-mysqllogbin-files

  • 我已经重新安装了另一个 WSL
  • 按照指南从 .frm 和 .idb 恢复数据库
  • 在 IMPORT TABLESPACE 之前一切顺利。 MySQL一直在说: ERROR 1812 (HY000): Tablespace is missing for table `dbname`.`table`
2019-05-16T03:04:36.061132Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2019-05-16T03:04:36.207628Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2019-05-16T03:04:36.208347Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2019-05-16T03:04:36.472045Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-05-16T03:04:36.481592Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.26-0ubuntu0.16.04.1) starting as process 15703 ...
2019-05-16T03:04:36.503219Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-05-16T03:04:36.503655Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-05-16T03:04:36.503712Z 0 [Note] InnoDB: Uses event mutexes
2019-05-16T03:04:36.503749Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-05-16T03:04:36.503783Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-05-16T03:04:36.503823Z 0 [Note] InnoDB: Using Linux native AIO
2019-05-16T03:04:36.504677Z 0 [Note] InnoDB: Number of pools: 1
2019-05-16T03:04:36.505431Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-05-16T03:04:36.521629Z 0 [ERROR] InnoDB: Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
2019-05-16T03:04:36.521855Z 0 [Note] InnoDB: You can disable Linux Native AIO by setting innodb_use_native_aio = 0 in my.cnf
2019-05-16T03:04:36.521899Z 0 [Warning] InnoDB: Linux Native AIO disabled.
2019-05-16T03:04:36.525155Z 0 [Note] InnoDB: Initializing buffer pool, total size = 4G, instances = 8, chunk size = 128M
2019-05-16T03:04:37.245621Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-05-16T03:04:37.452784Z 0 [Note] InnoDB: page_cleaner coordinator priority: -20
2019-05-16T03:04:37.453044Z 0 [Note] InnoDB: page_cleaner worker priority: -20
2019-05-16T03:04:37.453378Z 0 [Note] InnoDB: page_cleaner worker priority: -20
2019-05-16T03:04:37.453477Z 0 [Note] InnoDB: page_cleaner worker priority: -20
2019-05-16T03:04:37.461387Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2019-05-16T03:04:37.587188Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 22709914082 and the end 22709914054.
2019-05-16T03:04:37.587391Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-05-16T03:04:37.890878Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-05-16T03:04:37.891081Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-05-16T03:04:37.891128Z 0 [ERROR] Failed to initialize builtin plugins.
2019-05-16T03:04:37.891164Z 0 [ERROR] Aborting

2019-05-16T03:04:37.891207Z 0 [Note] Binlog end
2019-05-16T03:04:37.891332Z 0 [Note] Shutting down plugin 'CSV'
2019-05-16T03:04:37.891962Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2019-05-16T03:04:37.959132Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended ````

【问题讨论】:

  • 你在你的 my.cnf/ini 文件中做了什么特别的事情吗?它看起来像bug 85307 吗?在您的恢复中,您是否使用了备份时的redo logs
  • 实际上我已经尝试过使用 Innodb 恢复模式 4 和 6。没什么特别的。对于尚未尝试使用 redo_logs 进行恢复。让我再试一次
  • @danblack 尝试了你所有的建议,但仍然失败:(

标签: mysql innodb windows-subsystem-for-linux


【解决方案1】:

对于 [ERROR] InnoDB:此平台不支持 Linux Native AIO 接口。请检查您的操作系统文档并安装相应的 InnoDB 二进制文件。
解决方案:
/etc/mysql/my.cnf 中添加以下行强>

[mysqld]
innodb_use_native_aio = 0

对于[ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 92858715 and end 92858687.
解决方法:
删除/var/lib/mysql

中的 ib_logfiles
sudo rm -rf /var/lib/mysql/ib_logfile*

【讨论】:

    【解决方案2】:

    我遇到了类似的问题。我在 docker 中使用 MySQL,但这个解决方案对两者都是相同的。您需要删除 ib_logfiles 如果你没有使用 docker,那么

    rm -rf /var/lib/mysql/ib_logfile*
    

    如果你使用 docker 那么

    cd /your_mount_path/
    

    然后运行

    rm -rf * ib_logfile*
    

    注意:请确保备份数据或卷,因为我最终丢失了数据。

    【讨论】:

    • 其实我别无选择。 - 接受丢失的数据库 - 重新安装整个 WSL :(
    【解决方案3】:

    如果有人在这里与 wix-embedded-mysql 苦苦挣扎,并且由于某种原因无法更改 WSL 发行版或主机 unix 系统中的 mysql 设置,您可以通过 custom mysqld setting .withServerVariable 禁用它,例如:

    .withServerVariable("innodb_use_native_aio", 0)
    

    该选项只有在您真的不关心代码中的 InnoDB 使用时才可行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 2018-08-20
      • 2013-01-04
      • 1970-01-01
      • 2012-04-23
      • 2022-06-10
      • 2014-03-29
      相关资源
      最近更新 更多