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

前端 未结 6 1203
情话喂你
情话喂你 2020-12-10 14:40

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

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 15:39

    I have simply applied the refactorings using Windows and then reimported the database into Debian - it works.

    I think it's safe to say that something was messed up on the Debian server, or with the linux version of Mysql - perhaps a bug in 5.1 build?

    Anyway, I have also upgraded the ram on the server from 1gb to 2gb, and these problems have gone away.

    I think MySQL maybe just didn't have enough ram to complete the operation. If that was the case (and it seems to be), I think MySQL should have simply said so rather than spitting out these errors - making me and everyone here think it was a syntax or a schema-related problem.

    Anyway, thanks for those that tried to help. At least it helped me to isolate all the things it couldn't have been.

提交回复
热议问题