Row size too large error in mysql create table query

65535 bytes is the max row size for mysql.

With utf8mb4 charset, varchar(255) means this column at most uses 255 * 4 + 1 bytes. So it depends on what charset table use.


The total size of all fields in the table is more than the limit, 65535, that's why you are getting this error.

You should use text type instead of varchar for long strings. Replace all varchar(8000) with text, and it should work.

Or, even better, use appropriate data types instead of the "too large" ones. You don't really need 8000 characters to store currency, do you?


Use TEXT instead of VARCHAR. Because you're exceeding the maximum row size. if you use TEXT ,it is intended for large text columns. Max size of varchar is 65535. create a column with varchar(65535) but it would have to be the only column in the table.

or

problem is the row size limit for innodb tables, belowlinks you can find some approaches to solve this:

http://www.mysqlperformanceblog.com/2011/04/07/innodb-row-size-limitation/ https://dba.stackexchange.com/questions/6598/innodb-create-table-error-row-size-too-large

Tags:

Mysql