关于我的previous question,我的MySQL出了点问题。
我最近需要从MySQL中删除一个表,现在需要在原来的位置创建一个新表。我很难做到这一点,因为正如MySQL工作台所说,“这个表已经存在了。”由于来自MySQL工作台的错误没有什么特别的帮助,下面是我从错误日志中提取的一些内容。有什么问题吗?
我在Windows8.1Pro 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.发布于 2014-03-06 09:59:11
如果表存在,则只需使用drop table (http://dev.mysql.com/doc/refman/5.6/en/drop-table.html)将其删除
即
drop table <table name>你一定做错了什么,因为表仍然存在。
可以使用select进行检查
即
select * from <table name>发布于 2014-03-06 10:46:22
看起来您的innodb表空间已损坏。
从percona查看这篇文章
http://www.mysqlperformanceblog.com/2008/07/04/recovering-innodb-table-corruption/
这些工具
http://www.percona.com/software/percona-toolkit
他们会救你的!
我不知道它们在windows上运行得有多好,但这些工具的功能应该是一样的。
发布于 2015-07-09 23:50:27
转到mysql文件夹的安装位置: C:\Apps\mysql-5.6.25-win64\data\databasename
在databasename下,您可以找到您的表名。手动删除此表,然后使用SQL create table命令重新创建它。
https://stackoverflow.com/questions/22213292
复制相似问题