Question

I'm on a MYSQL database attempting to alter my table encoded in latin1 to UTF-8. The tables name is Journalist that has 12 columns listed as varchar with max length of 3000. This is the sql i'm running.

ALTER TABLE `journalist` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

The error I'm receiving

Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

Do I have to alter the size of the table before I run this conversion query? and/or how I might accomplish this encoding alteration otherwise?

Était-ce utile?

La solution

I did what @Wrikken suggested. I deleted my table and lowered varchar's max_length attributes to 1500 from 3000. I then ran this SQL on my new empty table

ALTER TABLE `table_name` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

from here, I repopulated it with my backup table, using a script.

To answer the question: Lower varchar max_length limits Or change varchar fields to LONGTEXT, or BLOBS

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top