Question

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

mysql> CREATE INDEX activity_type_id ON activity_log (activity_type_id); ERROR 1025 (HY000): Error on rename of './sample_production/activity_log' to './sample_production/#sql2-665c-7' (errno: -1)

it's some what difficult to search with the error number. Please help me out why this error happens.

Was it helpful?

Solution

According to this the problem may be related to innodb_force_recovery setting.

Run this to check if it's set to zero or not:

 SHOW VARIABLES LIKE 'innodb_force_recovery';

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top