sam wun wrote:
Hi,
I created an index on a foreign in a table before. I need to drop this index. but I got the following error:
mysql> alter table transaction drop index prodcode;
ERROR 1025 (HY000): Error on rename of './datacube/#sql-30e8_3' to './datacube/transaction' (errno: 150)
- you need to drop the foreign key constraint before you can drop the index on the column. Foreign keys must be explicitly indexed in MySQL... which means the reverse also holds true. Use SHOW CREATE TABLE to discover the name of the foreign key constraint. Alternatively, you can use SET FOREIGN_KEY_CHECKS = 0 to turn off referentiality checking.
- ian
-- +-------------------------------------------------------------------+ | Ian Sales Database Administrator | | | | "If your DBA is busy all the time... | | ...he's not doing his job properly" | | eBuyer http://www.ebuyer.com | +-------------------------------------------------------------------+
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]