I am using Oracle MySQL 5.0.88 in CentOS 5.7 (64-bit). When i am trying to create an index to the tables means it shows
我在CentOS 5.7(64位)中使用Oracle MySQL 5.0.88。当我试图创建表的索引意味着它显示
mysql> CREATE INDEX
activity_type_id
ONactivity_log
(activity_type_id
); ERROR 1025 (HY000): Error on rename of './sample_production/activity_log' to './sample_production/#sql2-665c-7' (errno: -1)mysql> CREATE INDEX activity_type_id ON activity_log(activity_type_id); ERROR 1025(HY000):将'./sample_production/activity_log'重命名为'./sample_production/#sql2-665c-7'时出错(错误号:-1)
it's some what difficult to search with the error number. Please help me out why this error happens.
这是一些难以搜索的错误号码。请帮我解释为什么会发生此错误。
3 个解决方案
#1
5
According to this
the problem may be related to innodb_force_recovery
setting.
据此,该问题可能与innodb_force_recovery设置有关。
Run this to check if it's set to zero or not:
运行此命令以检查它是否设置为零:
SHOW VARIABLES LIKE 'innodb_force_recovery';
#2
0
You might have a foreign key relation on that index. Then InnoDB doesn't let you do so. First of all, remove the foreign key first which is gonna remove the index anyway. More information about the error 1025 check out here.
您可能在该索引上具有外键关系。然后InnoDB不允许你这样做。首先,首先删除要删除索引的外键。有关错误1025的更多信息,请查看此处。
#3
0
I was getting a very similar error. In the end I discovered that SELinux was blocking me from making any changes to my tables. After adjusting the SELinux rules all is OK again.
我得到了一个非常相似的错误。最后我发现SELinux阻止我对我的表进行任何更改。调整SELinux规则后,一切都可以了。
#1
5
According to this
the problem may be related to innodb_force_recovery
setting.
据此,该问题可能与innodb_force_recovery设置有关。
Run this to check if it's set to zero or not:
运行此命令以检查它是否设置为零:
SHOW VARIABLES LIKE 'innodb_force_recovery';
#2
0
You might have a foreign key relation on that index. Then InnoDB doesn't let you do so. First of all, remove the foreign key first which is gonna remove the index anyway. More information about the error 1025 check out here.
您可能在该索引上具有外键关系。然后InnoDB不允许你这样做。首先,首先删除要删除索引的外键。有关错误1025的更多信息,请查看此处。
#3
0
I was getting a very similar error. In the end I discovered that SELinux was blocking me from making any changes to my tables. After adjusting the SELinux rules all is OK again.
我得到了一个非常相似的错误。最后我发现SELinux阻止我对我的表进行任何更改。调整SELinux规则后,一切都可以了。