Jump to content

Recommended Posts

i will try to describe this as much as I can.

 

So i have db with some tables which index names were not named as I wanted, so I decided to drop all the current tables and make them again with the new names for the indexes.

 

Now after dropping the tables I try to create it again and I get error ERROR 1005: Can't create table './db/table.frm' (errno: 150), which is a foreign key constraint error. But how can this be ?!? I dropped the table and now i am creating it without any foreign key / index (gonna add them when i will finish adding the tables) and it still says that foreign key constraint fails. Which is more odd is that it is referring to an old table which also does not exist.  ???

 

I am really confused. Have this happened to some1 else ? Have you solved the problem? Or this is some kind of db corruption that happened when i was droping and creating new tables?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/157955-mysql-problem/
Share on other sites

Well the tables were for work in progress and not valid data in it. So renaming all indexes was kinda too much trouble and I thought that dropping the tables and recreating them (have sql queries  from the program that i am creating the design) would be easier.

 

I already dropped the whole db and recreated it from scratch :( Something that I thought was easier and faster ended up in loosing whole day in troubleshooting :S Ahh well I guess it happens.

 

P.S. I think that the Fk on the other end matched the one i was creating. Think i checked that. But thanks anyway. Will keep that in mind for next time ;)

Link to comment
https://forums.phpfreaks.com/topic/157955-mysql-problem/#findComment-833970
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.