gpt4 book ai didi

服务中缺少 MySql - 无法打开 innodb_index_stats.ibd

转载 作者:行者123 更新时间:2023-11-30 21:49:00 25 4
gpt4 key购买 nike

我在 Windows 10 上安装了 Ampps 3.7,虽然 Apache 运行正常,但 Mysql 将不再启动;它过去运行正常,但现在出现 innidb 错误。我的问题类似于问题 here , 除了我没有升级 mysql 之外,建议的解决方案是删除并恢复几个 inno_db 表。但是,当我无法连接到 mysql 时,我该怎么做呢

我读过 thisthis两者都说将以下内容添加到 my.ini

innodb_force_recovery = 1

Ampps Mysql 错误日志说:

2018-01-05 12:17:46 11096 [Warning] You need to use --log-bin to make --binlog-format work.
2018-01-05 12:17:46 11096 [Note] Plugin 'FEDERATED' is disabled.
2018-01-05 12:17:46 11096 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-01-05 12:17:46 11096 [Note] InnoDB: The InnoDB memory heap is disabled
2018-01-05 12:17:46 11096 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-01-05 12:17:46 11096 [Note] InnoDB: Memory barrier is not used
2018-01-05 12:17:46 11096 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-01-05 12:17:46 11096 [Note] InnoDB: Not using CPU crc32 instructions
2018-01-05 12:17:46 11096 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-01-05 12:17:46 11096 [Note] InnoDB: Completed initialization of buffer pool
2018-01-05 12:17:46 11096 [Note] InnoDB: Highest supported file format is Barracuda.
2018-01-05 12:17:46 11096 [Note] InnoDB: The log sequence numbers 1600637 and 1600637 in ibdata files do not match the log sequence number 3531342 in the ib_logfiles!
2018-01-05 12:17:46 11096 [Note] InnoDB: Database was not shutdown normally!
2018-01-05 12:17:46 11096 [Note] InnoDB: Starting crash recovery.
2018-01-05 12:17:46 11096 [Note] InnoDB: Reading tablespace information from the .ibd files...
2018-01-05 12:17:46 11096 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace invoiceplane/ip_invoice_custom uses space ID: 2 at filepath: .\invoiceplane\ip_invoice_custom.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd
InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.

有什么想法吗?

更新:

删除 2 个 ib_logfile 最初有效,但随后它们重新出现(可能在重启后)。通过再次删除这 2 个文件,我能够启动 mysql,但列出了以下错误:

... Many similar errors precede with different page numbers
2018-01-10 13:24:50 10a8 InnoDB: Error: page 329 log sequence number 2371974
InnoDB: is in the future! Current system log sequence number 1601046.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: for more information.
2018-01-10 13:24:50 980 InnoDB: Error: page 0 log sequence number 3484405
InnoDB: is in the future! Current system log sequence number 1601046.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: for more information.
2018-01-10 13:24:50 3032 [Note] InnoDB: 5.6.35 started; log sequence number 1601036
2018-01-10 13:24:50 3032 [Note] Server hostname (bind-address): '*'; port: 3306
2018-01-10 13:24:50 3032 [Note] IPv6 is available.
2018-01-10 13:24:50 3032 [Note] - '::' resolves to '::';
2018-01-10 13:24:50 3032 [Note] Server socket created on IP: '::'.
2018-01-10 13:24:50 3032 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2018-01-10 13:24:50 3032 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
2018-01-10 13:24:50 3032 [Warning] InnoDB: Cannot open table mysql/slave_worker_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2018-01-10 13:24:50 3032 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2018-01-10 13:24:50 3032 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.
2018-01-10 13:24:50 3032 [Note] Event Scheduler: Loaded 0 events
2018-01-10 13:24:50 3032 [Note] mysql\bin\mysqld.exe: ready for connections.
Version: '5.6.35' socket: '' port: 3306 MySQL Community Server (GPL)

删除日志文件显然不能解决根本原因。

似乎我不是唯一遇到 MySql on Ampps 问题的人.

最佳答案

我遇到了完全相同的问题,并按照您指出的那样通过将 innodb_force_recovery = 1 添加到 my.ini 来修复它。不要忘记:

  1. 保存配置并重启 MySQL。
  2. 现在停止 MySQL,删除刚刚添加的行并再次启动 MySQL。

注意:您也可以简单地将 innodb_force_recovery 的值更改为 0 而不是删除它

作为link你在这里指出建议,这很重要

这对我来说是最好的解决方案,不像那些要求你在 mysql 甚至无法启动 O.o 时运行 sql 查询的解决方案

关于服务中缺少 MySql - 无法打开 innodb_index_stats.ibd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48113598/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com