服务中缺少mysql-无法打开innodb\u index\u stats.ibd

krugob8w  于 2021-06-21  发布在  Mysql
关注(0)|答案(2)|浏览(432)

我在windows10上安装了ampps3.7,虽然apache运行正常,但mysql将不再启动;它以前运行正常,但现在有一个innidb错误。我的问题与这里的问题类似,只是我没有升级mysql,建议的解决方案是删除并恢复几个innou db表。但是,当我无法连接到mysql时,我该怎么做呢
我读过这篇文章,这篇文章都说在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.

有什么想法吗?

更新:

删除2ibu日志文件最初是有效的,但随后它们又出现了(可能是在重新启动之后)。通过再次删除这两个文件,我可以启动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)

删除日志文件显然不能解决根本原因。
似乎我不是唯一一个在ampps上对mysql有问题的人。

cedebl8k

cedebl8k1#

这里的答案对我有用:

open the following folder
Ampps/mysql/data/
delete all files like ib_logfile**and mysql-bin.index,mysql-bin.****,
then start or restart MySQL via the AMPPS pannel

对我来说只有两个ibu日志文件。

p8h8hvxi

p8h8hvxi2#

我有完全相同的问题,并通过添加 innodb_force_recovery = 1 就像你说的那样。别忘了:
保存配置并重新启动mysql。
现在停止mysql,删除刚才添加的行并再次启动mysql。
注意:您也可以简单地更改 innodb_force_recovery 而不是删除它
正如你在这里指出的链接所表明的,这是非常重要的
对于我来说,这是最好的解决方案,不像那些在mysql甚至无法启动o.o时需要运行sql查询的解决方案

相关问题