Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8602627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:07:53+00:00 2026-06-12T02:07:53+00:00

I am trying to remove a foreign key from a table but I am

  • 0

I am trying to remove a foreign key from a table but I am getting this error below in mysql:

1025 – Error on rename of ‘./mobile_app/Question’ to ‘./mobile_app/#sql2-4517-15515’ (errno: 152)

What does this error mean and how can it be fixed?

Below is the code where I am trying to drop the foreign key:

alter table Question drop foreign key FK_Option_Table;

Below is the Question Table details (no rows in this table):

CREATE TABLE `Question` (
 `SessionId` varchar(10) NOT NULL DEFAULT '',
 `QuestionId` int(5) NOT NULL,
 `QuestionContent` varchar(5000) NOT NULL,
 `NoofAnswers` int(2) NOT NULL,
 `AnswerId` int(10) NOT NULL AUTO_INCREMENT,
 `ReplyId` varchar(2) NOT NULL,
 `QuestionMarks` int(4) NOT NULL,
 `OptionId` varchar(3) NOT NULL,
 PRIMARY KEY (`SessionId`,`QuestionId`),
 KEY `FK_Option_Table` (`OptionId`),
 KEY `FK_IndividualQuestion` (`QuestionId`),
 KEY `FK_Reply` (`ReplyId`),
 KEY `FK_AnswerId` (`AnswerId`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8

Below is the Option_Table details:

CREATE TABLE `Option_Table` (
 `OptionId` varchar(3) NOT NULL,
 `OptionType` varchar(20) NOT NULL,
 PRIMARY KEY (`OptionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

There are 24 rows in this table and below is a sample:

OptionId OptionType
O1       A-C
O2       A-D
O3       A-E
O4       A-F
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:07:55+00:00Added an answer on June 12, 2026 at 2:07 am

    Those are index’s not foreign keys you have. I see no foreign keys in your create statements.

    Example to create foreign key.

    ALTER TABLE `Question` 
      ADD CONSTRAINT `SessionId`
      FOREIGN KEY (`SessionId` )
      REFERENCES `Option_Table` (`OptionId` )
      ON DELETE NO ACTION
      ON UPDATE CASCADE
    , ADD INDEX `test_idx` (`SessionId` ASC) ;
    
    ALTER TABLE `Question` DROP FOREIGN KEY `SessionId` ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to remove an object from a collection in entity framework, but
I'm trying to remove scrollbar from my facebook app. I tried js solution, that
I'm trying to remove wiki formatting from some text so it can be parsed.
I'm trying to remove a specific graph object from the zedgraph, is it possible....?
I am trying to remove an object from an ArrayList and here is the
Hello I was trying to remove objects from object array that I have and
I asked this ages ago but worded the question badly. I'm trying to specify
I'm trying to remove a child entity from a parent collection navigation property. There
So I was trying to work this out but it seems that the last
Trying to remove loading animations when individual images have finished loading but have run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.