Error On Rename Of Errno 152
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring
Error On Rename Errno 150
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question error on rename of errno 150 mysql x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
Error On Rename Of '#sql' To ' Errno 150
it only takes a minute: Sign up unable to drop the foreign key up vote 15 down vote favorite 2 I would like to drop the foreign key in my table but been into this error message mysql> alter mysql error 1025 errno 152 table customers drop foreign key customerid; ERROR 1025 (HY000): Error on rename of '.\products\customers' to '.\products\#sql2-7ec-a3' (errno: 152) mysql> mysql foreign-keys foreign-key-relationship mysql-error-1025 share|improve this question edited May 17 '12 at 9:18 Fahim Parkar 15.8k2395193 asked May 17 '12 at 8:57 solomon 1171210 1 This may help you to understand stackoverflow.com/questions/160233/… –Imdad May 17 '12 at 9:04 @Imdad This link describes another error - (errno: 150) –Devart May 17 '12 at 9:17 Try this. mysql error code 1005 errno 150 Create new table (without foreign key constraint). copy the data to new table (using syntax INSERT INTO new_table SELECT * FROM old_table) Drop the old table –Imdad May 17 '12 at 9:22 Have you checked @Maksym Polshcha's answer? You have to use the foreign key's name not the column name. (it might be something like fk_customerid) –Imdad May 17 '12 at 9:24 check my answer and let me know if you still have problem... –Fahim Parkar May 17 '12 at 9:37 | show 1 more comment 4 Answers 4 active oldest votes up vote 5 down vote accepted To avoid getting this error while trying to drop a foreign key, use the constraint name rather than the column name of the foreign key. When I tried mysql> ALTER TABLE mytable DROP PRIMARY KEY; I got error as ERROR 1025 (HY000): Error on rename of '.\database\#sql-454_3' to '.\database\mytable' (errno: 150). I solved it using: mysql> ALTER TABLE mytable DROP PRIMARY KEY, ADD PRIMARY KEY (column1,column2,column3); Some links that will help you. link 1 link 2 [look for Posted by Alex Blume on November 7 2008 5:09pm & Posted by Hector Delgadillo on January 21 2011 4:57am] share|improve this answer answered May 17 '12 at 9:34 Fahim Parkar 15.8k2395193 not work for me. –user60627 May 25 at 5:49 add a comment| up vote 20 down vote The solution described here by
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
#1025 - Error On Rename Of (errno 150)
of this site About Us Learn more about Stack Overflow the company mysql error 1025 errno 150 Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
General Error: 1025 Error On Rename Of Laravel
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: http://stackoverflow.com/questions/10632587/unable-to-drop-the-foreign-key Sign up What does mysql error 1025 (HY000): Error on rename of './foo' (errorno: 150) mean? up vote 122 down vote favorite 46 I tried this in mysql: mysql> alter table region drop column country_id; And got this: ERROR 1025 (HY000): Error on rename of './product/#sql-14ae_81' to './product/region' (errno: 150) Any ideas? Foreign key stuff? mysql mysql-error-1025 share|improve this question edited Dec http://stackoverflow.com/questions/160233/what-does-mysql-error-1025-hy000-error-on-rename-of-foo-errorno-150-me 5 '09 at 7:00 OMG Ponies 199k36356415 asked Oct 1 '08 at 23:33 Trenton 3,55063238 @skiphoppy - Are you trying to give a bounty to an already-given-answer? Is that even allowed? Or is your case different, in which case you should start another thread? –Rick James Jan 9 at 6:35 @RickJames Yes it is. However, skiphoppy should add her comment under the answer she elected, as the bouty message will disappear when the bounty is over. –RandomSeed Jan 11 at 15:25 add a comment| 10 Answers 10 active oldest votes up vote 180 down vote accepted You usually get this error if your tables use the InnoDB engine. In that case you would have to drop the foreign key, and then do the alter table and drop the column. But the tricky part is that you can't drop the foreign key using the column name, but instead you would have to find the name used to index it. To find that, issue the following select: SHOW CREATE TABLE region; This should show you the name of the index, something like this:
Verified Impact on me: None Category:MySQL Server: Parser Severity:S2 (Serious) Version:5.0.15, 5.0.74, 5.1.30, https://bugs.mysql.com/bug.php?id=14347 6.0.9 OS:Linux (Linux Suse 10, Windows) Assigned to: Tags: foreign key, innodb Triage: Triaged: D5 (Feature request) View Add Comment Files Developer Edit Submission View https://confluence.atlassian.com/fishkb/mysql-sql-script-error-drop-foreign-key-314449915.html Progress Log Contributions [26 Oct 2005 18:53] Vadim Tkachenko Description: When I try ALTER TABLE ORDERS DROP FOREIGN KEY CUSTOMERID; I got: ERROR 1025 error on (HY000): Error on rename of './TESTDB/ORDERS' to './TESTDB/#sql2-3b5b-8' (errno: 152) But I only want to remove FOREIGN KEY and I don't delete any rows. How to repeat: DROP TABLE IF EXISTS `ORDERS`; CREATE TABLE `ORDERS` ( `ORDERID` int(11) NOT NULL auto_increment, `ORDERDATE` date NOT NULL, `CUSTOMERID` int(11) default NULL, error on rename `NETAMOUNT` decimal(12,2) NOT NULL, `TAX` decimal(12,2) NOT NULL, `TOTALAMOUNT` decimal(12,2) NOT NULL, PRIMARY KEY (`ORDERID`), KEY `IX_ORDER_CUSTID` (`CUSTOMERID`), CONSTRAINT `FK_CUSTOMERID` FOREIGN KEY (`CUSTOMERID`) REFERENCES `CUSTOMERS` (`CUSTOMERID`) ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `CUSTOMERS`; CREATE TABLE `CUSTOMERS` ( `CUSTOMERID` int(11) NOT NULL auto_increment, `FIRSTNAME` varchar(50) NOT NULL, `LASTNAME` varchar(50) NOT NULL, `ADDRESS1` varchar(50) NOT NULL, `ADDRESS2` varchar(50) default NULL, `CITY` varchar(50) NOT NULL, `STATE` varchar(50) default NULL, `ZIP` int(11) default NULL, `COUNTRY` varchar(50) NOT NULL, `REGION` tinyint(4) NOT NULL, `EMAIL` varchar(50) default NULL, `PHONE` varchar(50) default NULL, `CREDITCARDTYPE` int(11) NOT NULL, `CREDITCARD` varchar(50) NOT NULL, `CREDITCARDEXPIRATION` varchar(50) NOT NULL, `USERNAME` varchar(50) NOT NULL, `PASSWORD` varchar(50) NOT NULL, `AGE` tinyint(4) default NULL, `INCOME` int(11) default NULL, `GENDER` varchar(1) default NULL, PRIMARY KEY (`CUSTOMERID`), UNIQUE KEY `IX_CUST_USERNAME` (`USERNAME`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `CUSTOMERS` VALUES (1,'VKUUXF','ITHOMQJNYX','4608499546 Dell Way','','QSDPAGD','SD',24101,'US',1,'ITHOMQJNYX@dell.com',' 4608499546',1,'1979279217775911','2012/03','user1','password',55,100000,'M'),(2,'HQNMZH','UNUKXHJVXB','5119315633 Dell Way','','YNCE RXJ','AZ',11802,'US',1,'UNUKXHJVXB@dell.com','5119315633',1,'3144519586581737','2012/11','user2','password',80,40000
talking to database: Problem running drop script (you may have to manually drop the DB) /data1/attlasian/fecru-2.9.1/sql/MYSQL/schema/drop_67.sql at com.atlassian.crucible.migration.item.SQLBackup.restore(SQLBackup.java:201) at com.atlassian.crucible.migration.item.SQLBackup$1.restore(SQLBackup.java:169) at com.cenqua.fisheye.ctl.Restore.run(Restore.java:191) at com.cenqua.fisheye.ctl.Restore.main(Restore.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ... Caused by: com.cenqua.crucible.hibernate.CruDBException: Problem running drop script (you may have to manually drop the DB) /data1/attlasian/fecru-2.9.1/sql/MYSQL/schema/drop_67.sql ... Caused by: com.cenqua.crucible.hibernate.CruDBException: SQL script error on line 1: "alter table cru_changeset_comment drop foreign key FK1C588BB9C50DAE44;" (Error on rename of './fisheyedb/cru_changeset_comment' to './fisheyedb/#sql2-3eed-26559' (errno: 152)), please contact http://www.atlassian.com/support/ ... Caused by: java.sql.SQLException: Error on rename of './fisheyedb/cru_changeset_comment' to './fisheyedb/#sql2-3eed-26559' (errno: 152) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096) Symptom 2 Upgrading FishEye fails with the following error inatlassian-fisheye-