Phpmyadmin Error On Rename Errno 150
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
Error 1025 (hy000) Error On Rename Of (errno 152)
the company Business Learn more about hiring developers or posting ads with us Stack general error: 1025 error on rename of laravel Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community error 1025 outlook mac of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up #1025 - Error on rename of './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150) up vote 59 down vote favorite
Mysql Rename Foreign Key
13 So I am trying to add a primary key to one of the tables in my database. Right now it has a primary key like this: PRIMARY KEY (user_id, round_number) Where user_id is a foreign key. I am trying to change it to this: PRIMARY KEY (user_id, round_number, created_at) I am doing this in phpmyadmin by clicking on the primary key icon in the table structure view. This is the error
How To Drop Foreign Key In Mysql
I get: #1025 - Error on rename of './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150) It is a MySQL database with InnoDB table engine. mysql sql phpmyadmin innodb mysql-error-1025 share|improve this question edited Apr 30 '11 at 17:29 OMG Ponies 199k37361417 asked Nov 2 '10 at 17:55 Richard Knop 23.6k95284462 1 A quick search using Google gives me the idea that this problem is related to constraints. Possible helpful links: dev.mysql.com/doc/refman/5.0/en/innodb-error-codes.html and simplicidade.org/notes/archives/2008/03/mysql_errno_150.html –Lekensteyn Nov 2 '10 at 18:01 add a comment| 6 Answers 6 active oldest votes up vote 104 down vote accepted There is probably another table with a foreign key referencing the primary key you are trying to change. To find out which table caused the error you can run SHOW ENGINE INNODB STATUS and then look at the LATEST FOREIGN KEY ERROR section. share|improve this answer edited Nov 20 '14 at 11:00 trejder 6,5031366131 answered Nov 2 '10 at 18:50 Ike Walker 33.6k95278 add a comment| up vote 18 down vote For those who are getting to this question via google... this error can also happen if you try to rename a field that is acting as a foreign key. share|improve this answer answered Jun 20 '13 at 13:03 Dave C 267521 add a comment| up vote 18 down vote
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 laravel migration drop foreign key about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
Error 1005: Can't Create Table
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each mysql drop foreign key if exists other. Join them; it only takes a minute: Sign up #1025 - Error on rename (errno: 150) in mysql up vote 8 down vote favorite 1 I am trying to drop a foreign key(id) in one table(misc) which http://stackoverflow.com/questions/4080611/1025-error-on-rename-of-database-sql-2e0f-1254ba7-to-database-table is the primary key(id) in table(main). db name(xxx) alter table misc drop FOREIGN KEY id I am getting this error #1025 - Error on rename of '.\interview#sql-edc_27' to '.\interview\misc' (errno: 150) mysql share|improve this question edited Oct 29 '13 at 20:43 juergen d 126k21133198 asked Oct 29 '13 at 20:42 black 69131224 possible duplicate of #1025 - Error on rename of './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150) –Kermit Oct 29 '13 at 20:50 add a comment| 2 http://stackoverflow.com/questions/19668682/1025-error-on-rename-errno-150-in-mysql Answers 2 active oldest votes up vote 14 down vote accepted SHOW CREATE TABLE misc ; You can't drop the foreign key using the column name,run the above query to find out the correct name,something like misc_ibfk_1 Heh,IT IS this name: alter table misc drop FOREIGN KEY misc_ibfk_1 share|improve this answer answered Oct 29 '13 at 20:50 Mihai 15.3k52542 ALTER TABLE misc DROP COLUMN id to drop column . thanks –black Oct 29 '13 at 21:00 add a comment| up vote 1 down vote In my case, was necessary to make a 3-step process (my table is named "articulos", and the hard-to-remove index is "FK_Departamento_ID") For knowing the name of table, I executed: SHOW INDEX FROM articulos; This statement resolved the issue (#1025, errno: 150), but the index remained in the table ALTER TABLE articulos DROP FOREIGN KEY FK_Departamento_ID; The following statement finally wiped out the index DROP INDEX FK_Departamento_ID ON articulos; share|improve this answer answered Sep 11 '15 at 15:58 ZooMMX 4917 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other q
Community Podcasts MySQL.com Downloads Documentation Section Menu: MySQL Forums :: InnoDB :: errno 150 - foreign key problems New Topic Advanced Search errno 150 - foreign key problems Posted by: Paul Blazek () Date: June 09, 2006 http://forums.mysql.com/read.php?22,95361 03:50PM I'm using 5.0.19 on Linux and MySQL Admin 1.1.9. I was changing column http://www.dbforums.com/showthread.php?925650-Error-while-trying-to-alter-table-(errno-150) names in some tables with foreign key references, and I am now at the point that I cannot change a table from MyISAM to InnoDB due to a non-existant foreign key constraint. SHOW CREATE TABLE FUN_Function yields: CREATE TABLE `FUN_Function` ( `FUNlFunctionKey` int(11) NOT NULL default '0', `FUNvc255Description` varchar(255) collate latin1_general_ci NOT NULL default '', `FUNTCOlFunctionAccessKey` int(11) foreign key NOT NULL default '0', `FUNvc50Group1` varchar(50) collate latin1_general_ci default NULL, `FUNvc50Group2` varchar(50) collate latin1_general_ci default NULL, PRIMARY KEY (`FUNlFunctionKey`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci yet when I try to ALTER TABLE FUN_Function ENGINE=InnoDB the result is: ERROR 1025 (HY000): Error on rename of './TXCAD/#sql-5912_86' to './TXCAD/FUN_Function' (errno: 150) and SHOW INNODB STATUS yields: LATEST FOREIGN KEY ERROR ------------------------ 060609 17:45:48 Error in foreign key constraint of table TXCAD/FUN_Function: there is error on rename no index in the table which would contain the columns as the first columns, or the data types in the table do not match to the ones in the referenced table. Constraint: , CONSTRAINT FK_FUN_Function_COD_Code FOREIGN KEY (FUNCODlFunctionAccessKey) REFERENCES COD_Code (CODlCodeKey) This FK reference is left over from before I made changes to the column names, but nothing I do seems to get rid of the CONSTRAINT. Suggestions, please? Navigate:Previous Message•Next Message Options:Reply•Quote Subject Views Written By Posted errno 150 - foreign key problems 55808 Paul Blazek 06/09/2006 03:50PM Re: errno 150 - foreign key problems 22390 Heikki Tuuri 06/12/2006 12:55AM Re: errno 150 - foreign key problems 13023 Paul Blazek 06/12/2006 08:22AM Re: errno 150 - foreign key problems 9319 mandilas 12/07/2006 07:28AM Re: errno 150 - foreign key problems 7791 Heikki Tuuri 06/12/2006 02:07PM Re: errno 150 - foreign key problems 6855 Nestor Martinez Arque 10/07/2008 04:58PM Re: errno 150 - foreign key problems 5741 KimSeong Loh 10/07/2008 05:55PM Sorry, you can't reply to this topic. It has been closed. powered by phorum 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. Conta
visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 7 of 7 Thread: Error while trying to alter table (errno: 150) Tweet Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 09-25-03,22:49 #1 Ronit View Profile View Forum Posts Registered User Join Date Sep 2003 Posts 2 Unanswered: Error while trying to alter table (errno: 150) Hi I am Trying to change column name in a table with no success :-( This is how I created the table : mysql> CREATE TABLE `Banks` ( -> `BankID` tinyint(2) unsigned zerofill NOT NULL default '00', -> `BankName` varchar(50) NOT NULL default '', -> `OpenDate` date NOT NULL default '0000-00-00', -> `CloseDate` date default NULL, -> `Datechanged` timestamp(14) NOT NULL, -> `UserChanged` varchar(8) default NULL, -> PRIMARY KEY (`BankID`,`OpenDate`,`Datechanged`) -> ) TYPE=InnoDB -> ; Query OK, 0 rows affected (0.01 sec) Now I want to change the column BankID to CustomerId so I do the folowing , as BankID is part of the primary key I am tring to drop the key first before I change column name: mysql> alter table Banks drop primary key ; ERROR 1025: Error on rename of './bp/#sql-efc_1' to './bp/Banks' (errno: 150) I have tried a different approach , drop the Banks Table and create a new one: mysql> drop table Banks ; Query OK, 0 rows affected (0.01 sec) mysql> CREATE TABLE `Banks` ( -> `CustomerId` tinyint(2) unsigned zerofill NOT NULL default '00', -> `BankName` varchar(50) NOT NULL default '', -> `OpenDate` date NOT NULL default '0000-00-00', -> `CloseDate` date default NULL, -> `Datechanged` timestamp(14) NOT NULL, -> `UserChanged` varchar(8) default NULL, -> PRIMARY KEY (`CustomerId`,`O