Questions tagged [mysql-error-1025]

Error 1025 - Error on rename of '%s' to '%s' (errno: %d)

Error 1025 - Error on rename of '%s' to '%s' (errno: %d)

31 questions
443
votes
9 answers

Error renaming a column in MySQL

How do I rename a column in table xyz? The columns are: Manufacurerid, name, status, AI, PK, int I want to rename to manufacturerid I tried using PHPMyAdmin panel, but I get this error: MySQL said: Documentation #1025 - Error on rename of…
Bharanikumar
  • 25,457
  • 50
  • 131
  • 201
227
votes
11 answers

MySQL Removing Some Foreign keys

I have a table whose primary key is used in several other tables and has several foreign keys to other tables. CREATE TABLE location ( locationID INT NOT NULL AUTO_INCREMENT PRIMARY KEY ... ) ENGINE = InnoDB; CREATE TABLE assignment ( …
Drew
  • 15,158
  • 17
  • 68
  • 77
163
votes
14 answers

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?
Trenton
  • 11,678
  • 10
  • 56
  • 60
84
votes
7 answers

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

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,…
Richard Knop
  • 81,041
  • 149
  • 392
  • 552
51
votes
7 answers

Renaming foreign-key columns in MySQL

We're trying to rename a column in MySQL (5.1.31, InnoDB) that is a foreign key to another table. At first, we tried to use Django-South, but came up against a known issue: http://south.aeracode.org/ticket/243 OperationalError: (1025, "Error on…
Greg Detre
  • 653
  • 1
  • 5
  • 9
27
votes
5 answers

unable to drop the foreign key

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:…
13
votes
4 answers

How do I delete a foreign key constraint in SQLAlchemy?

I'm using SQLAlchemy Migrate to keep track of database changes and I'm running into an issue with removing a foreign key. I have two tables, t_new is a new table, and t_exists is an existing table. I need to add t_new, then add a foreign key to…
Travis
  • 4,018
  • 4
  • 37
  • 52
10
votes
3 answers

MySQL (InnoDB): need to delete column, and accompanying foreign key constraint and index

Here's my table: CREATE TABLE `alums_alumphoto` ( `id` int(11) NOT NULL auto_increment, `alum_id` int(11) NOT NULL, `photo_id` int(11) default NULL, `media_id` int(11) default NULL, `updated` datetime NOT NULL, PRIMARY KEY …
nmjk
  • 749
  • 3
  • 9
  • 25
9
votes
6 answers

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

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…
egervari
  • 22,372
  • 32
  • 121
  • 175
8
votes
1 answer

Dropping a column with a foreign key

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…
shealtiel
  • 8,020
  • 18
  • 50
  • 82
8
votes
4 answers

MySQL Error when dropping index (errno 150)

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…
Jakub Arnold
  • 85,596
  • 89
  • 230
  • 327
8
votes
2 answers

Changing MySQL primary key when foreign key contraints exist

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…
wisnij
  • 317
  • 1
  • 3
  • 9
4
votes
2 answers

SQL Foreign Key Constraint Error 1025 (152)

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…
Xavier
  • 8,244
  • 18
  • 54
  • 85
3
votes
2 answers

Changing a column collation

I have a database already set up. I am trying to change the collation to case sensitive on my username column so it restricts login parameters to what they signed up with. However I keep getting this: #1025 - Error on rename of…
Stefan P
  • 1,013
  • 2
  • 18
  • 34
2
votes
4 answers

Altering a table primary key which has foreign key constrains in mysql

I have a mysql database which have set of tables One table have a composite key as the primary key and and a single foreign key. Following are the table definitions. CREATE TABLE IF NOT EXISTS `ohrm_emp_education` ( `emp_number` int(11) NOT…
Thilanka
  • 1,733
  • 5
  • 21
  • 36
1
2 3