views:

51

answers:

2

Hey there, 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 is 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

A: 

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.

Sabeen Malik
A: 

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.

chris
It's still not released to the public, so I'm stopping the problem before hand. I am going to make it so they can only login using the exact username so it's the same across the board when data is stored form sessions! How can I drop the foreign key temporarily?
Stefan
ALTER TABLE tbl_name DROP FOREIGN KEY fk_symbol;
chris