1025 - Error On Rename Of
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
#1025 - Error On Rename Of (errno 150)
this site About Us Learn more about Stack Overflow the company Business Learn #1025 - error on rename of mysql more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
#1025 - 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; it only takes a minute: Sign up error code 1025. error on rename of (errno 150) #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 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 error on rename of (errno 150) edited Oct 29 '13 at 20:43 juergen d 125k21130195 asked Oct 29 '13 at 20:42 black 68931124 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 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.2k52442 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
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
Error On Rename Of '#sql' To ' Errno 150
this site About Us Learn more about Stack Overflow the company Business error 1025 (hy000) error on rename of (errno 152) Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask
General Error 1025 Error On Rename Of Laravel
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: Sign http://stackoverflow.com/questions/19668682/1025-error-on-rename-errno-150-in-mysql 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 5 '09 http://stackoverflow.com/questions/160233/what-does-mysql-error-1025-hy000-error-on-rename-of-foo-errorno-150-me at 7:00 OMG Ponies 198k36356415 asked Oct 1 '08 at 23:33 Trenton 3,51563238 @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 176 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 K
Hugo. RSS Feed. Baron Schwartz's Blog MySQL's ERROR 1025 explained Tue, Aug 22, 2006 in Databases MySQL issues a http://www.xaprb.com/blog/2006/08/22/mysqls-error-1025-explained/ cryptic error message, “Error on rename,” when you try to alter a table in such a way that it would break a foreign key constraint: https://confluence.atlassian.com/confkb/mysql-error-1025-thrown-when-attempting-to-change-table-collation-and-character-set-785332187.html create table test1(a int not null primary key)engine=innodb; create table test2(a int not null, foreign key(a) references test1 (a)) engine=innodb; alter table test2 modify a error on smallint not null; ERROR 1025 (HY000): Error on rename of './test/#sql-2fa8_1' to './test/test2' (errno: 150) This happens because ALTER TABLE really works by making a copy of the table, then renaming to move the old table out of the way and move the new table into its place. It is error on rename certainly one of the less meaningful error messages I’ve seen in MySQL. There’s slightly more information in the output of SHOW ENGINE INNODB STATUS, if you are looking there (of course, if you’re looking there you’re probably already clued in to what’s going on). And innotop can parse that information for you: In case you didn’t understand why the foreign key constraint was failing, the error message innotop parses out is much clearer. It’s because the foreign key columns in the parent and child table have to have the same data type. I was trying to change the child’s column to an incompatible type. I'm Baron Schwartz, the founder and CEO of VividCortex. I am the author of High Performance MySQL and many open-source tools for performance analysis, monitoring, and system administration. I contribute to various database communities such as Oracle, PostgreSQL, Redis and MongoDB. Newer Older Comments
to the Restricted functions in Atlassian Cloud apps, the contents of this article cannot be applied to Atlassian Cloud applications. Problem An attempt of repairing collation and character set on table level (MySQL database) resulted in the following errors. ERROR 1025 (HY000): Error on rename of './confluence/#sql-23f9_59586' to './confluence/logininfo' (errno: 150) Diagnosis Execute the following command against your MySQL database to get more detailed information on the error. show engine innodb status; You should be seeing an error similar to the one shown below: ------------------------ LATEST FOREIGN KEY ERROR ------------------------ 151026 2:07:01 Error in foreign key constraint of table confluence/logininfo: there is no index in the table which would contain the columns as the first columns, or the data types in the table do not match the ones in the referenced table or one of the ON ... SET NULL columns is declared NOT NULL. Constraint: , CONSTRAINT "FK_logininfo_USERNAME" FOREIGN KEY ("USERNAME") REFERENCES "user_mapping" ("user_key") Cause Referential integrity (foreign key constrains check) failed while attempting to change the table's collation and character set. For more information, please refer tothis link. Workaround Temporarily disable the foreign key constraints check when altering the table collation by executing the following queries before and after the alter attempt itself: Disable Foreign Key Constraints SET FOREIGN_KEY_CHECKS=0; Reattempt to change the collation and character set for a particular table ALTER TABLE `tableName` CHARACTER SET utf8 COLLATE utf8_bin Enable back the Foreign Key Constraints SET FOREIGN_KEY_CHECKS=1; Please do take note to generate a full backup of your Confluence database before then proceed with the suggested workaround as preventive measures. Was this helpful? Yes No Thanks for your feedback! Why was this unhelpful? It wasn't accurate It wasn't clear It wasn't relevant Submit feedback Cancel Have a question about this article? See questions about this article Powered by Confluence and Scroll Viewport Atlassian Support Ask the community Provide product feedback Contact technical support Atlassian Privacy Policy Terms of use Security Copyright © 2016 Atlassian Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 2.5 Australia License.