我创建的以“dotNetChat_”开头的表在重启MySQL后消失

时间:2014-03-05 23:16:06

标签: mysql windows-8.1

根据新信息,我创建了一个新问题here,可以更好地解释我打算解决的问题。

我正在尝试在MySQL中创建一组表,这些表都以prefrix dotNetChat_开头。最初我将这些表设置在另一台服务器上,尽管它们配置了相同的my.ini文件,但一切正常。每当我第一次创建这些表时,它们都会正常显示,但在重新启动MySQL后,它们会“消失”,并尝试使用MySQL Workbench加载表内容,从而产生以下错误:

  

错误代码:1146。表'thepwf_prgminteractions.dotnetchat_testtable'不存在

我检查了我的错误日志文件,这是我发现的:

2014-03-05T23:05:31.224646Z 1 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2014-03-05T23:05:33.755361Z 2 [ERROR] InnoDB: Failed to find tablespace for table "thepwf_prgminteractions"."dotnetchat_testtable" in the cache. Attempting to load the tablespace with space id 24.
2014-03-05 18:05:33 0x1f30  InnoDB: Operating system error number 32 in a file operation.
InnoDB: The error means that another program is using InnoDB's files.
InnoDB: This might be a backup or antivirus software or another instance
InnoDB: of MySQL. Please close it to get rid of this error.
2014-03-05T23:05:33.760362Z 2 [ERROR] InnoDB: Could not find a valid tablespace file for 'thepwf_prgminteractions/dotnetchat_testtable'. See http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2014-03-05 18:05:33 0x1f30 InnoDB: cannot calculate statistics for table "thepwf_prgminteractions"."dotnetchat_testtable" because the .ibd file is missing. For help, please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html
2014-03-05 18:05:34 0x1f30 InnoDB: cannot calculate statistics for table "thepwf_prgminteractions"."dotnetchat_testtable" because the .ibd file is missing. For help, please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html
2014-03-05 18:05:34 0x1f30 InnoDB: cannot calculate statistics for table "thepwf_prgminteractions"."dotnetchat_testtable" because the .ibd file is missing. For help, please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html
2014-03-05 18:05:35 0x1e54 InnoDB: cannot calculate statistics for table "thepwf_prgminteractions"."dotnetchat_testtable" because the .ibd file is missing. For help, please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html

在考虑检查我的日志文件之前,我认为服务器可能有问题,所以我卸载了服务器,删除了所有服务器数据文件,重新安装了它,放了我已经配置的my.ini配置文件已经做好了准备,并开始做好准备。这可能是什么问题?每当我尝试删除任何包含或包含此类表的模式时,我都会从MySQL Workbench中收到以下错误:

Could not Drop Object

enter image description here

编辑:我已经继续玩了一段时间了,并且在使用IOBit确保所有MySQL文件在重新安装之前被删除之后,我在尝试时遇到错误导入表格。 MySQL Workbench的错误是无用的,但是错误日志中的内容可能会有所帮助。

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 个答案:

答案 0 :(得分:2)

我会说,由于某种原因,MySQL被拒绝访问InnoDB文件,然后无法加载,并且没有它们就继续。你能否验证你的进程没有运行两次,并且MySQL用户是在有权访问MySQL lib目录的帐户下运行的。

我的研究结果基于这个错误:

[ERROR] InnoDB: Failed to find tablespace for table "thepwf_prgminteractions"."dotnetchat_testtable" in the cache. Attempting to load the tablespace with space id 24.
2014-03-05 18:05:33 0x1f30  InnoDB: Operating system error number 32 in a file operation.
InnoDB: The error means that another program is using InnoDB's files.
InnoDB: This might be a backup or antivirus software or another instance
InnoDB: of MySQL. Please close it to get rid of this error.

错误32,基于http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx表示:

ERROR_SHARING_VIOLATION
32 (0x20)
The process cannot access the file because it is being used by another process.

正如我所说,这意味着文件被另一个进程锁定。当你重新启动MySQL时会发生这种情况,因为当你创建MySQL时,MySQL会让它们打开,而另一个进程无法锁定它们。一旦MySQL服务停止(重启),另一个进程就会锁定文件,MySQL再次启动时无法打开它们。

要查看系统上的锁定文件以及锁定哪个进程,您可以使用http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

您需要以管理员身份运行CMD Prompt,并键入以下内容:

handle.exe thepwf_

哪个应该显示哪个进程正在锁定文件。

让我知道你发现了什么。