Innodb

對名為“tmp”的不存在數據庫進行 InnoDB 數據字典清理?

  • October 7, 2019

我的 error.log 文件中有許多這樣的錯誤消息,它們引用了啟動 mariadb 10.4.8 伺服器時無法打開的不同文件:

2019-09-30 17:38:19 0 [ERROR] InnoDB: Cannot open datafile for read-only: '/tmp/#sql50b_8808_1.ibd' OS error: 71
2019-09-30 17:38:19 0 [ERROR] InnoDB: Cannot read first page of './tmp/#sql50b_8808_1.ibd' I/O error
2019-09-30 17:38:19 0 [Note] InnoDB: Cannot read first page in datafile: ./tmp/#sql50b_8808_1.ibd, Space ID:18446744073709551615, Flags: 0
2019-09-30 17:38:19 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2019-09-30 17:38:19 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
2019-09-30 17:38:19 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2019-09-30 17:38:19 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``tmp`.`#sql50b_8808_1``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2019-09-30 17:38:19 0 [Warning] InnoDB: Ignoring tablespace for `tmp`.`#sql50b_8808_1` because it could not be opened.

我沒有名為 的數據庫tmp,因此數據字典故障排除的說明沒有幫助。

我在我的文件系統中找不到任何以#sql任何位置開頭的文件,但是

SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES
WHERE NAME LIKE '%#sql%';

返回 65 行,包括與上述文件關聯的行。有什麼方法可以清理它,這樣 MariaDB 就不會嘗試打開這些不存在的文件?

我能夠使用備份我的數據庫、刪除和重新安裝 MariaDB 以及恢復我的數據庫的蠻力方法來解決這個問題。

引用自:https://dba.stackexchange.com/questions/249970