2014-03-06 117 views
1

我遇到了與MySQL有關的問題,與我的previous question有關。無法在MySQL中創建表,因爲「它已經存在」

我最近需要從MySQL中刪除一個表,現在需要在它的位置創建一個新表。我對此很難接受,因爲正如MySQL Workbench所說,「表格已經存在。」由於來自MySQL Workbench的錯誤不是特別有用,下面是我從錯誤日誌中取出的一些內容。有什麼問題?

我在Windows 8.1 Pro x64上運行MySQL 5.7。

2014-03-06T01:38:55.459658Z 0 [ERROR] InnoDB: Table thepwf_prgminteractions/p2p_messagedata in the InnoDB data dictionary has tablespace id 25, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary. 
InnoDB: Please refer to 
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html 
InnoDB: for how to resolve the issue. 
2014-03-06T01:38:55.464671Z 0 [ERROR] InnoDB: Table thepwf_prgminteractions/p2p_onlineusers in the InnoDB data dictionary has tablespace id 26, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary. 
InnoDB: Please refer to 
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html 
InnoDB: for how to resolve the issue. 
2014-03-06T01:38:55.468672Z 0 [ERROR] InnoDB: Table thepwf_prgminteractions/p2pchat_betaaccesskeys in the InnoDB data dictionary has tablespace id 24, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary. 

回答

1

如表存在,那麼只需用DROP TABLE(http://dev.mysql.com/doc/refman/5.6/en/drop-table.html)刪除

drop table <table name> 

你一定做錯了什麼作爲表仍然存在。

可與select

select * from <table name> 
+0

'drop table thepwf_prgminteractions'返回一個「Unknown Table」錯誤。 – DavidB

+0

@davidB - 你是否正在使用正確的數據庫,即在使用前使用' –

+0

是的。此外,我在我的評論中提出的查詢是錯誤的。我的意思是說'p2pChat_betaAccessKeys'。 – DavidB

1

檢查這個看起來你的InnoDB表已損壞。

結帳此帖來自Percona的

http://www.mysqlperformanceblog.com/2008/07/04/recovering-innodb-table-corruption/

而且這些工具

http://www.percona.com/software/percona-toolkit

他們會救你!

嗯,我不知道他們在windows上運行得如何,但是這些工具的功能應該差不多。

+0

我不知道如何使用這些工具來解決問題,即使通過閱讀這兩個頁面。我注意到,只有當我將'lower_case_table_names'設置爲'2'時,該問題纔會出現在名稱中具有下劃線的表中。 – DavidB

0

轉到安裝你的mysql文件夾中: C:\ APPS \ mysql的,25年6月5日 - Win64的\ DATA \數據庫名稱

在數據庫名稱,你會發現你的表名。手動刪除此表並使用SQL Create Table命令再次創建它。

相關問題