开发者

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 './yebutno_ybn/#sql-76dc_8581dc' to './yebutno_ybn/user' (errno: 150)

there i开发者_开发知识库s foreign key constraints due to related tables....

any ideas? this will save me a lot of hassle with the php side of things!

Thanks, Stefan


In addition to disabling FOREIGN_KEY_CHECKS, you could just drop the foreign key, do you stuff, recreate it. Probably not a good idea if rebuilding the index might take a real long time.

Be aware, changing collation might orphan some rows. STEfan will no longer be related to stefan...so you might want to investigate this to see if you will have any occurrences, and decide what you will do about it, before you proceed.


I think you can turn off foreign key constraints by using something like:

SET FOREIGN_KEY_CHECKS = 0;

After your done adjusting, then you can enable them back. However i would recommend making a copy of the db and trying this on the copy first.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜