I've an old db with columns'charset to latin1
Now i'm trying to change the whole db in utf8, i've made a script to change all the tables in utf8 like this:
ALTER TABLE `mytable` CHARACTER SET utf8;
and all the columns like this:
ALTER TABLE `mytable` CHANGE `mycolumn` `mycolumn` varchar(200) CHARACTER SET utf8;
But on some columns (primary keys and constraints, i guess) i'm getting this error:
Error on rename of './test/#sql-5028_217b96' to './test/mytable' (errno: 150)
Anyone knows how to get around this?
The most likely your mycolumn
is a part of a foreign key. If so, you have to remove the constraint, then change type for the both primary/foreign key and then add constraint again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With