mysql - Changing collation on indexed columns without changing data -


i trying change collation on bunch of columns. don't want mess current data, i've been looking @ doing in this answer:

alter table modify name blob;

the next step convert column nonbinary data type proper character set:

alter table modify name varchar(12) character set hebrew collate hebrew_bin;

or try this:

alter table modify name varchar(12) character set utf8 collate utf8_unicode_ci

unfortunately, mysql won't let me convert indexed column blob.

sql error: [1170] - blob/text column 'baz' used in key specification without key length

query: alter table foo.bar modify baz blob;

is there way around this? or need somehow remove indexes , rebuild them after conversion?

don't "2-step alter" unless character set wrong data 'right'. if want convert both character set , data, use alter table convert character set ...;

see case 5 in my blog, which, might guess, has other cases.

as error 1170 -- had index. before that, decide whether relevant.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -