Hope you have a great day. I have a table with 470 columns to be exact. I am working on Django unit testing and the tests won't execute giving the error when I run command python manage.py test:
Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline
To resolve this issue I am trying to increase the innodb_page_size
in MySQL my.cnf file. When I restart MySQL server after changing value in my.cnf file, MySQL won't restart.
I have tried almost every available solution on stackoverflow but no success.
MYSQL version=5.5.57 Ubuntu version = 16.04
Any help would be greatly appreciated. Thank you
Since I have never seen anyone use the feature of having bigger block size, I have no experience with making it work. And I recommend you not be the first to try.
Instead I offer several likely workarounds.
Don't use VARCHAR(255)
blindly; make the lengths realistic for the data involved.
Don't use uf8 (or utf8mb4) for columns that can only have ascii. Examples: postcode, hex strings, UUIDs, country_code, etc. Use CHARACTER SET ascii
.
Vertically partition the table. That is spit it into two tables with the same PRIMARY KEY
.
Don't splay arrays across columns; use another table and have multiple rows in it. Example: phone1, phone2, phone3.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.