I am trying to create a table with the below query
Create Table PerformaceReport
(
campaignID int,
keywordID bigint,
keyword varchar(8000),
avgPosition decim
This problem came out in Laravel and I used text instead of varchar.
I agree with the answer on using appropriately sized columns and TEXT over VARCHAR as the first step, but if you still hit limits you may want to change your collation settings for that table if you are using UTF-8 or another character set with more than one byte per character and do not need it (only storing English text for example). I did this to get around the limit you are hitting for a very wide table. Some more detail here.
Differences between utf8 and latin1
Try changing the storage engine to CSV.
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