1

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?

Dap
  • 2,309
  • 5
  • 32
  • 44
  • Have a look at [*create table error: “Row size too large”*](http://dba.stackexchange.com/questions/6598/innodb-create-table-error-row-size-too-large) and [*Change limit for “Mysql Row size too large”*](http://stackoverflow.com/questions/15585602/change-limit-for-mysql-row-size-too-large) – M Khalid Junaid Feb 17 '14 at 19:22
  • 1
    _"You have to change some columns to TEXT or BLOBs"_... well, seems like it. _Unless_ you don't actually need 3000 characters in those fields, and can configure them to be a lot less. – Wrikken Feb 17 '14 at 20:29

1 Answers1

1

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

Dap
  • 2,309
  • 5
  • 32
  • 44