saving base64 data - row size too large issue

旧街凉风 提交于 2019-12-30 07:28:11

问题


I have 22 database fields of type longtext. If I try saving 12 of the fields with the following data I get the following error:

#1118 - Row size too large. The maximum row size for the used table type, not     
counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs 

It saves fine if I only save 11 fields. Here's the data:

BYOkQoFxB5+S8VH8svilSI/hQCUDlh1wGhyHacxjNpShUKlGJJ5HZ1DQTKGexBaP65zeJksfOnvBloCSbVmNgYxQhaQHn7sJlKjwtC00X/me2K8Vs4I9cL9SZx58Q2iXXQBbJYaAhn0LaEJMUN0P7VWd0/MiKgXsJt0UiXBf7Rlo6JIooBlaf59zA+II1o3MJKmzyH4q7C1qm2bC0LIT79ZCWDDSdqQaKZ1k1gPMu+yDYQPjrNiQUW29K/AdJ/XpPHT50jaJUjoMv9fL2TK0bUMO0VGe+0Cf4j0BE3QHlFnHqdgnLCTWk8NVo5U4Y5XTObsZtWwd1wHFZNIatuvg0cQk6WHojx3H9HavxKs9JJWYp8eCywyLhjmF39jMoZRT4n8fSTGDGif2q3VJE7DQrmQTjyQkSl9yUWvcTTUHAyNRYKnthVbgbzOOhEvhOZPuD4h+dcGyiW/xk+Lvu2XqkMDBIBuLcKymrdhefi4DElpuwyKFH7DNt6Y3fllPN/0XuSF0YXPqnBDLUcZsMqdzWPZX4RoVza/0Do+mHejYUSYnhsFWtPUHlTnU6fojBqw0icoKqhwjcIVpZmATwgYwXclsSwqEBWm9q9DMNzXG73bq6bs29BKq3E9S/fxo9Bz3mThNaj33fhyD4mj8indAIQeLVWvW3dq4T8+0lao6Ll0=

How can I fix the issue? How can I increase the bytes of the row size so it is more than 8126?


回答1:


The problem is the row size limit for InnoDB tables, in this links 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



回答2:


Columns of type Varchar's, text, and blob arent included in the innodb row size limit.. so if you have a lot of columns that aren't you can get that error.

I had a load of char(1)'s that I changed to varchar and it fixed the problem nicely



来源:https://stackoverflow.com/questions/8220489/saving-base64-data-row-size-too-large-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!