Error Code 1025. 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 #1025 - error on rename of (errno 150) and policies of this site About Us Learn more about Stack Overflow general error 1025 error on rename of laravel the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags #1025 - error on rename of (errno 152) Users Badges 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
Mysql Error 1025 Errno 150
takes a minute: Sign up Error when trying to DELETE foreign key: “ERROR 1025 (HY000):” up vote 7 down vote favorite I am running into some trouble trying to delete a foreign key. Could someone please help? Here’s my SHOW CREATE TABLE catgroup: | catgroup | CREATE TABLE `catgroup` ( `catgroupid` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) NOT NULL, `group_id` error 1025 outlook mac int(11) NOT NULL, PRIMARY KEY (`catgroupid`), KEY `category_id` (`category_id`), KEY `group_id` (`group_id`), CONSTRAINT `catgroup_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `cat s` (`cid`) ON UPDATE CASCADE, CONSTRAINT `catgroup_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups d`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 | This is how I am trying to drop the foreign key: ALTER TABLE catgroup DROP FOREIGN KEY group_id_ibfk_2; And here’s the error message: ERROR 1025 (HY000): Error on rename of '.\asset_base\catgroup' to '.\asset_base\ sql2-16b4-4' (errno: 152) What am I doing wrong? mysql foreign-keys share|improve this question edited May 22 '13 at 15:56 Federico Razzoli 1,594615 asked Aug 15 '11 at 8:23 Henkka 3623817 add a comment| 3 Answers 3 active oldest votes up vote 6 down vote You have the wrong name of the foreign key. Try catgroup_ibfk_2 instead. The strange error message is already reported as a bug in MySQL. share|improve this answer answered Aug 15 '11 at 8:26 Emil Vikström 59.2k1183130 add a comment| up vote 2 down vote Ancient post, but FWIW I just discovered that the foreign key name is case sensitive... share|improve this ans
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 developers or posting laravel migration drop foreign key ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Error Code 1025 Outlook Mac
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:
Mysql Rename 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): http://stackoverflow.com/questions/7062910/error-when-trying-to-delete-foreign-key-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 5 '09 at 7:00 OMG Ponies 198k36356415 asked Oct 1 '08 at 23:33 Trenton 3,54063238 @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 http://stackoverflow.com/questions/160233/what-does-mysql-error-1025-hy000-error-on-rename-of-foo-errorno-150-me 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 179 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: CONSTRAINT region_ibfk_1 FOREIGN KEY (country_id) REFERENCES country (id) ON DELETE NO ACTION ON UPDATE NO ACTION Now simply issue an: alter table region drop foreign key region_ibfk_1; And finally an: alter table region drop column country_id; And you are good to go! share|improve this answer answered Apr 11 '11 at 0:45 Jeshurun 13.2k44869 7 If I could upvote this twice I would. Cheers! Great walk through. –Rudiger Mar 1 '12 at 3:19 9 This should be the correct answer.Thanks! –PinoyStackOverflower Jul 17 '12 at 14:12 You saved my bacon. Thanks for this answer. I have seen similar solutions via google search, but yours actually worked for me, thank you! –mason81 Jul 7 '14 at 20:35 @Pin
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 https://bugs.mysql.com/bug.php?id=42416 key, innodb Triage: Triaged: D5 (Feature request) View Add Comment Files Developer Edit Submission View 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
Updates: Status: Duplicate Impact on me: None Category:MySQL Server: Errors Severity:S3 (Non-critical) Version: 5.0.51a-3ubuntu5.4 (Ubuntu) OS:Linux Assigned to: View Add Comment Files Developer Edit Submission View Progress Log Contributions [28 Jan 2009 12:08] James b Description: see below I have seen http://bugs.mysql.com/bug.php?id=14347 but it doesn't seem to provide an answer. How to repeat: mysql> create database testing; Query OK, 1 row affected (0.00 sec) mysql> use testing; Database changed mysql> CREATE TABLE IF NOT EXISTS CollectionInfo ( -> CollectionName VARCHAR(255) NOT NULL PRIMARY KEY -> ) ENGINE=InnoDB; Query OK, 0 rows affected (0.01 sec) mysql> mysql> mysql> CREATE TABLE IF NOT EXISTS CollectionRequestHandler ( -> ID INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, -> CollectionName VARCHAR(255), -> CONSTRAINT `crh_cn` FOREIGN KEY (CollectionName) REFERENCES CollectionInfo(CollectionName) ON DELETE CASCADE -> ) ENGINE=InnoDB; Query OK, 0 rows affected (0.00 sec) mysql> mysql> ALTER TABLE CollectionInfo DROP FOREIGN KEY `crh_cn`; ERROR 1025 (HY000): Error on rename of './testing/CollectionInfo' to './testing/#sql2-1907-ed' (errno: 152) [28 Jan 2009 15:45] Valerii Kravchuk Thank you for a problem report. I had re-opened and verified that Bug #14347. This is a duplicate. Legal Policies Your Privacy Rights Terms of Use Contact Us Portions of this website are copyright © 2001, 2002 The PHP Group Page generated in 0.019 sec. using MySQL 5.7.12-enterprise-commercial-advanced-log Content reproduced on this site is the property of the respective copyright holders.It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party. © 2016, Oracle Corporation and/or its affiliates