mysql-error-1025

Dropping a column with a foreign key

亡梦爱人 提交于 2020-01-01 12:06:10
问题 On my mysql DB with inno_db engine, I have a table with a foreign key. I want to drop the column (along with the foreign key and the associated index of course - i don't need the whole column!) Now, simply dropping it yields an error: General error: 1025 Error on rename of '.\road_dmy#sql-19d8_2be' to '.\road_dmy\contact' (errno: 150) It sounds like this is a known issue. http://bugs.mysql.com/bug.php?id=15317 But anyway, what should i do to drop this column? I'm very sure it's possible

unable to drop the foreign key

别来无恙 提交于 2019-12-18 01:42:32
问题 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 '.\products\#sql2-7ec-a3' (errno: 152) mysql> 回答1: 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

Problem adding Foreign Key using Alter Table with existing MYSQL Database - can't add it! Help!

 ̄綄美尐妖づ 提交于 2019-12-17 19:38:49
问题 I have a production database where I have renamed several column's that are foreign keys. Obviously mysql makes this a real pain to do in my experience. My solution was to drop all the indexes and foreign keys, rename the id columns, and then re-add the indexes and foreign keys. This works great on mysql 5.1 on windows for the development database. I went to run my migration script on my debian server, which is also using mysql 5.1, and it gives the following error: mysql> ALTER TABLE

SQL Foreign Key Constraint Error 1025 (152)

六眼飞鱼酱① 提交于 2019-12-12 12:24:23
问题 I keep getting an error every time i try to drop a table called "countires" and a field called "countries". #1025 - Error on rename of '.\mutli_page_form\survey' to '.\mutli_page_form\#sql2-820-1fb' (errno: 152) It says there is a FK dependency on the table "survey" i have tried multiple times to delete it to no success. #1217 - Cannot delete or update a parent row: a foreign key constraint fails I now get this error once trying to delete the table of Countries 回答1: The database has been told

ALTER TABLE error

*爱你&永不变心* 提交于 2019-12-11 06:19:18
问题 Can someone explain to me why I am receiving the following error? I want to rename the column "exerciseID" to "ID" in a mysql table using the following syntax. ALTER TABLE `exercises` CHANGE `exerciseID` `ID` INT( 11 ) NOT NULL AUTO_INCREMENT However I receive the following error: MySQL said: #1025 - Error on rename of './balance/#sql-de_110e' to './balance/exercises' (errno: 150) Any suggestions would be much appreciated 回答1: I would check to see if you have any foreign key references to

MySQL Error when dropping index (errno 150)

最后都变了- 提交于 2019-12-10 03:19:06
问题 I've got problem with dropping foreign key index, I always get the same error ALTER TABLE `comments` DROP INDEX `id_user` which outputs 1025 - Error on rename of './postuj_cz1/#sql-d834_a0c704' to './postuj_cz1/comments' (errno: 150) The id_user on the other table is simple primary key index. I'm using MySQL version 5.0.85 回答1: According to this link, the error relates to the definition of the primary key field. The error isn't about the foreign key index. Check the primary key for the

MySQL Error when dropping index (errno 150)

感情迁移 提交于 2019-12-05 04:11:57
I've got problem with dropping foreign key index, I always get the same error ALTER TABLE `comments` DROP INDEX `id_user` which outputs 1025 - Error on rename of './postuj_cz1/#sql-d834_a0c704' to './postuj_cz1/comments' (errno: 150) The id_user on the other table is simple primary key index. I'm using MySQL version 5.0.85 According to this link , the error relates to the definition of the primary key field. The error isn't about the foreign key index. Check the primary key for the COMMENTS table to make sure it does not have the UNSIGNED keyword while the COMMENTS.id_user foreign key had the

Changing MySQL primary key when foreign key contraints exist

三世轮回 提交于 2019-11-29 13:34:16
I have two already-existing tables which look (in part) roughly like this: CREATE TABLE parent ( old_pk CHAR(8) NOT NULL PRIMARY KEY ) ENGINE=InnoDB; CREATE TABLE child ( parent_key CHAR(8), FOREIGN KEY (parent_key) REFERENCES parent(old_pk) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB; I want to add a new auto-incrementing integer id column to parent and use it as the primary key instead, while still keeping old_pk as a unique key and allowing other tables like child to reference it in foreign key contraints. Unfortunately, simply saying ALTER TABLE parent DROP PRIMARY KEY doesn't work

unable to drop the foreign key

半腔热情 提交于 2019-11-28 22:50:34
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 '.\products\#sql2-7ec-a3' (errno: 152) mysql> 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

#1025 - Error on rename of './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150)

我是研究僧i 提交于 2019-11-28 15:56:43
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 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. Ike Walker There is probably another table with a foreign key referencing