Mysql Error 1025 Hy000 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 error 1025 (hy000) error on rename of (errno 152) this site About Us Learn more about Stack Overflow the company Business Learn mysql error 1025 errno 150 more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
General Error: 1025 Error On Rename Of Laravel
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up
Error 1025 Outlook Mac
What does mysql error 1025 (HY000): Error on rename of './foo' (errorno: 150) mean? up vote 123 down vote favorite 47 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 at 7:00 error code 1025 outlook mac OMG Ponies 199k37360417 asked Oct 1 '08 at 23:33 Trenton 3,56063238 @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 181 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 countr
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
How To Drop Foreign Key In Mysql
this site About Us Learn more about Stack Overflow the company Business Learn mysql rename foreign key more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question alembic drop foreign key x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up http://stackoverflow.com/questions/160233/what-does-mysql-error-1025-hy000-error-on-rename-of-foo-errorno-150-me Help with: ERROR 1025 (HY000): Error on rename of … (errno: 150) up vote 35 down vote favorite 7 I am getting this error when I am trying to run an alter table command to drop a column: ERROR 1025 (HY000): Error on rename of .... (errno: 150). If I understand correctly it is a foreign key problem, but I do not have a http://stackoverflow.com/questions/5948704/help-with-error-1025-hy000-error-on-rename-of-errno-150 clue how to fix it. Would somebody be so kind and tell me how to get it working. The code used for creating table: CREATE TABLE categories( cid INT AUTO_INCREMENT NOT NULL PRIMARY KEY, assets_id INT NOT NULL, cat_name VARCHAR(30) NOT NULL, INDEX(assets_id), FOREIGN KEY (assets_id) REFERENCES asset(aid) ON UPDATE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=utf8; The alter command: ALTER TABLE categories DROP COLUMN assets_id; The table categories is completely blank. So there is no information to set off the CASCADE restrictions. So could you help me what kind of wizardry do I need to delete the column assets_id. Thank you. mysql share|improve this question edited May 10 '11 at 10:50 Manoj 3,43574364 asked May 10 '11 at 10:31 Henkka 3623817 add a comment| 3 Answers 3 active oldest votes up vote 66 down vote accepted Use SHOW CREATE TABLE categories to show the name of constraint. Most probably it will be categories_ibfk_1 Use the name to drop the foreign key first and the column then: ALTER TABLE categories DROP FOREIGN KEY categories_ibfk_1; ALTER TABLE categories DROP COLUMN assets_id; share|improve this answer answered May 10 '11 at 10:37 Quassno
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 http://stackoverflow.com/questions/10632587/unable-to-drop-the-foreign-key about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges https://codedump.io/share/Z3hjdZCDC9mF/1/what-does-mysql-error-1025-hy000-error-on-rename-of-39foo39-errorno-150-mean Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; 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 1025 error message mysql> alter 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.8k2396193 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 error on rename 9:17 Try this. 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.8k2396193 not work for me. –user60627 May 25 at 5:49 add a
Go Groovy Haml Handlebars Haskell HTML HTTP Ini iOS Jade Java Javascript jQuery JSON Julia Keyman LaTeX Linux Less LOLCODE Makefile Markdown MATLAB MySQL NASM Node.js NSIS Objective-C Pascal Perl PHP PHP Extras PowerShell Python R React JSX reST (reStructuredText) Rip Ruby Rust SAS Sass (Sass) Sass (Scss) Scala Scheme Smalltalk Smarty SQL Stylus Swift Twig TypeScript Vb.net VHDL Wiki markup YAML Other Search Trenton - 9 months ago 269x SQL Question What does mysql error 1025 (HY000): Error on rename of './foo' (errorno: 150) mean? 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? Anonymous Answer Email {} Share 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! Source (Stackoverflow) http://stackoverflow.com/questions/160233/what-does-mysql-error-1025-hy000-error-on-rename-of-foo-errorno-150-me Comments Please enable JavaScript to view the comments powered by Disqus. × Email codedump link for What does mysql error 1025 (HY000): Error on rename of './foo' (errorno: 150) mean? Email has been send. To emailaddress: To name: From name: Extra information in the email body (optional): Email: I am sending you the codedump of What does mysql error 1025 (HY000): Error on rename of './foo' (errorno: 150) mean? that you can see here: https://codedump.io/share/Z3hjdZCDC9mF/1 Close Send email Share Sign up Sign up with GitHub Email: Displayname Password: Repeat password: Tags mysql mysql-error-1025 Latest added quadtree 3d (2) quadtree 3d Twig display current year ReCAPTCHA In Laravel 5.2 Forms For Validation frame © 2016 CodeDump |Terms Privacy Rss API Sign in -Sign up For programmers by programmers Tag v2.2.4