简体   繁体   English

更改my.cnf文件中的innodb_page_size不会重新启动mysql数据库

[英]Changing innodb_page_size in my.cnf file does not restart mysql database

Hope you have a great day. 希望你有美好的一天。 I have a table with 470 columns to be exact. 我有一张包含470列的表格。 I am working on Django unit testing and the tests won't execute giving the error when I run command python manage.py test: 我正在进行Django单元测试,当我运行命令python manage.py test时,测试不会执行并给出错误:

Row size too large (> 8126). 行大小太大(> 8126)。 Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. 将某些列更改为TEXT或BLOB或使用ROW_FORMAT = DYNAMIC或ROW_FORMAT = COMPRESSED可能会有所帮助。 In current row format, BLOB prefix of 768 bytes is stored inline 在当前行格式中,内联存储了768个字节的BLOB前缀

To resolve this issue I am trying to increase the innodb_page_size in MySQL my.cnf file. 为了解决这个问题,我试图增加MySQL my.cnf文件中的innodb_page_size When I restart MySQL server after changing value in my.cnf file, MySQL won't restart. 当更改my.cnf文件中的值后重新启动MySQL服务器时,MySQL将不会重新启动。

I have tried almost every available solution on stackoverflow but no success. 我已经在stackoverflow上尝试了几乎所有可用的解决方案,但没有成功。

MYSQL version=5.5.57 Ubuntu version = 16.04 MYSQL版本= 5.5.57 Ubuntu版本= 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; 不要盲目使用VARCHAR(255) make the lengths realistic for the data involved. 使相关数据的长度切合实际。

Don't use uf8 (or utf8mb4) for columns that can only have ascii. 不要将uf8(或utf8mb4)用于只能具有ascii的列。 Examples: postcode, hex strings, UUIDs, country_code, etc. Use CHARACTER SET ascii . 例如:邮政编码,十六进制字符串,UUID,country_code等。请使用CHARACTER SET ascii

Vertically partition the table. 垂直分区表。 That is spit it into two tables with the same PRIMARY KEY . 那就是将其吐入两个具有相同PRIMARY KEY表中。

Don't splay arrays across columns; 不要跨列展开数组; use another table and have multiple rows in it. 使用另一个表并在其中包含多个行。 Example: phone1, phone2, phone3. 例如:phone1,phone2,phone3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM