gpt4 book ai didi

python - MySQL(1118,'行大小太大(> 8126))&增加 innodb_log_buffer 给我错误

转载 作者:行者123 更新时间:2023-11-29 09:37:01 24 4
gpt4 key购买 nike

我正在 Ubuntu 16.04 上运行临时服务器,

当我尝试保存特定文档时,出现以下错误:

OperationalError at /product/1172
(1118, '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.')

该文档包含许多文本字段,字符长度在 10 - 1000 之间。当我删除一些文本时,我实际上可以很好地保存文档。所以它可能是字符限制的。

有趣的是,当我尝试将相同的文档详细信息克隆到我的本地 MYSQL 版本中时,它工作得很好。所以我的下一个逻辑步骤是比较 innodb_ 全局变量。

我进行了比较,唯一不同的变量是 innodb_log_buffer_size 在本地设置为 16M,但在临时版本上设置为 8M。所以我尝试从 mysql.conf 的 [mysqld] 语句下进行设置。

但是,当我尝试重新启动 mysql 服务时,出现以下错误:

Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

在检查 error.log 文件时,我发现:


2019-08-07T05:42:54.144803Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2019-08-07T05:42:54.144847Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2019-08-07T05:42:54.302070Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please $
2019-08-07T05:42:54.303636Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as p$
2019-08-07T05:42:54.308390Z 0 [Warning] InnoDB: innodb-page-size has been changed from the default v$
2019-08-07T05:42:54.308451Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-08-07T05:42:54.308460Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-08-07T05:42:54.308464Z 0 [Note] InnoDB: Uses event mutexes
2019-08-07T05:42:54.308468Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory $
2019-08-07T05:42:54.308472Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-08-07T05:42:54.308475Z 0 [Note] InnoDB: Using Linux native AIO
2019-08-07T05:42:54.308706Z 0 [Note] InnoDB: Number of pools: 1
2019-08-07T05:42:54.308808Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-08-07T05:42:54.310251Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances $
2019-08-07T05:42:54.315213Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-08-07T05:42:54.316859Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleane$
2019-08-07T05:42:54.327052Z 0 [ERROR] InnoDB: Data file './ibdata1' uses page size 16384, but the in$
2019-08-07T05:42:54.327079Z 0 [ERROR] InnoDB: Corrupted page [page id: space=0, page number=0] of da$
2019-08-07T05:42:54.327088Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-08-07T05:42:54.928006Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-08-07T05:42:54.928037Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-08-07T05:42:54.928043Z 0 [ERROR] Failed to initialize builtin plugins.
2019-08-07T05:42:54.928046Z 0 [ERROR] Aborting

2019-08-07T05:42:54.928061Z 0 [Note] Binlog end
2019-08-07T05:42:54.928415Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

我仅在尝试添加innodb_log_buffer_size变量时出现此错误,而不是与任何其他innodb变量一起出现。

原来的 OpretaionalError 是由缓冲区变量较低引起的吗?如果是这样,我如何安全地将其更改为适当的范围?

Python:3.5.2 运行 Django

MYSQL:版本 14.14 Distrib 5.7.21,适用于 Linux (x86_64),使用 EditLine 包装器

服务器:Ubuntu 16.04 上的 Apache 2

最佳答案

谢谢大家!

我设法通过更改以下内容解决了该问题innodb_file_format = 梭子鱼innodb_large_prefix = 1

重新启动数据库

然后我不得不改变表ALTER TABLE [表名] ENGINE=INNODB ROW_FORMAT = DYNAMIC;

然后它就像魔术一样起作用了!显然,上面的错误与我的问题无关,是其他一些设置导致的,阻碍了文件格式的更改和大的前缀更改,正如 @Solarflare 指出的那样!

关于python - MySQL(1118,'行大小太大(> 8126))&增加 innodb_log_buffer 给我错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57388015/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com