标签:
删除mysql 数据库文件,导致表不能创建。看mysql的log显示如下。
150922 9:12:35 InnoDB: Error; possible reasons: InnoDB: 1) Table rename would cause two FOREIGN KEY constraints InnoDB: to have the same internal name in case-insensitive comparison. InnoDB: 2) table `crm`.`insight` exists in the InnoDB internal data InnoDB: dictionary though MySQL is trying to rename table `crm`.`action_value` to it. InnoDB: Have you deleted the .frm file and not used DROP TABLE? InnoDB: You can look for further help from InnoDB: http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html InnoDB: If table `crm`.`insight` is a temporary table #sql..., then it can be that InnoDB: there are still queries running on the table, and it will be InnoDB: dropped automatically when the queries end. InnoDB: You can drop the orphaned table inside InnoDB by InnoDB: creating an InnoDB table with the same name in another InnoDB: database and copying the .frm file to the current database. InnoDB: Then MySQL thinks the table exists, and DROP TABLE will InnoDB: succeed.
按log操作,从别的db创建相同的表,把对应的insight.frm拷到crm的文件目录下面,然后修改crm/insight.frm所属的用户和组,确保mysql有权限访问。
chown mysql data/crm/insight.frm chgrp mysql data/crm/insight.frm
最后 drop table insight;
然后便创建insight了。
mysql 1050 Table ‘./crm/insight‘ already exists
标签:
原文地址:http://my.oschina.net/mxs/blog/509741