mysql不生成ibd文件,MySQL InnoDB:由于缺少.ibd文件,因此无法计算统计信息

Environment:

Windows 7 (XAMPP latest)

Apache 2.4.4

PHP 5.5

MySQL 5.6.11

I am trying to backup a database from MySQL 5.1 and import it to MySQL 5.6.

In MySQL 5.1, there are some MyISAM and InnoDB tables. I use mysqldump to dump the SQL file out, with --add-drop-database switch.

Now when I go back to my localhost and import the SQL file using MySQL workbench, an error occur:

InnoDB: cannot calculate statistics for table "database"."tables" because the .ibd file is missing.

I tried drop the database using:

drop schema database

And it crashes the MySQL 5.6, with error like this:

2013-09-10 17:18:23 fc4 InnoDB: Warning: MySQL is trying to drop database `database`.``

InnoDB: though there are still open handles to table `database`.`table`.

In my.ini I set:

innodb_force_recovery = 4

I tried:

Create a new database with different database name and run the import again, all innodb tables cannot be created.

Copy all *.frm tables from a working 5.1 server in data directory, overwrite existing database, restart MySQL 5.6.11, all innodb tables cannot be accessed.

If I run a create table statement with engine=InnoDB, it will failed and said table already exists, which actually it does not exists.

If I run a drop table statement that using InnoDB, it will say table does not exists...

Can anyone please give me some advices on it?

Thank you.

解决方案

I had a similar problem on Mac OS X, but in a slightly bizarre way: I was running fine on some pre-5.6.19 version and then upgraded to 5.6.19, which started to give me the error message above, except none of my tables use mixed case.

As it turned out, one of my databases is using an uppercase character as its first letter. This has worked fine for a long time, but failed this morning after the minor version upgrade and sent me into a 2-hour search for what went wrong.

The fix is simple: create a symlink with the lower case version, restart mysqld and all is well. However, even though I understand the logic for making tables case-safe, there is no danger of the database name being ambiguous since the OS would always prevent that.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值