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 this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with drop index error 1025 hy000 error on rename of us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow
Error 1025 (hy000) Error On Rename Of (errno 152)
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 1025 (hy000) Error On Rename Of (errno 150)
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
Mysql Error On Rename
on rename of .... (errno: 150). If I understand correctly it is a foreign key problem, but I do not have a 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 general error 1025 error on rename of laravel 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,42564364 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 Quassnoi 261k50430482 Thank you! That did the trick. –Henkka May 10 '11 at 11:27 1 @Henkka: my pleasure. Please mark the answer as accepted (and do this for the other questions you asked too), this will encourage people to help you more. –Quassnoi May 10 '11 at 11:29 How can I mark them accepted? –Henkka May 10 '11 at 11:38 @Henkka: there is a check mark under the number of votes left to each answer. Click it so that it becomes green. –Quassnoi May 10 '11 at 11:40 Ok, thanks again. –Henkka May 10 '11 at 11:41 add a comment| up vote 0 down vote For me the problem was a different one: The site was (a
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 mysql error 1025 errno 150 this site About Us Learn more about Stack Overflow the company Business Learn error 1025 outlook mac more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question error code 1025 outlook mac 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 http://stackoverflow.com/questions/5948704/help-with-error-1025-hy000-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 edited http://stackoverflow.com/questions/19668682/1025-error-on-rename-errno-150-in-mysql Oct 29 '13 at 20:43 juergen d 125k21130196 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.3k52442 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 wip
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://stackoverflow.com/questions/10632587/unable-to-drop-the-foreign-key the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags 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 error 1025 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 message mysql> alter table customers drop foreign key customerid; ERROR 1025 (HY000): Error on rename of '.\products\customers' to error on rename '.\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. 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 w