如何设置全局innodb

编程入门 行业动态 更新时间:2024-10-11 17:19:25
本文介绍了如何设置全局innodb_buffer_pool_size?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何设置全局innodb_buffer_pool_size mySQL变量?当我将其设置为system display时,出现此错误:

How to set the global innodb_buffer_pool_size mySQL variable? When I set it to system display I get this error:

ERROR 1238 (HY000): Variable 'innodb_buffer_pool_size' is a read only variable

推荐答案

在早期版本的 MySQL(< 5.7.5)中,设置的唯一方法

In the earlier versions of MySQL ( < 5.7.5 ) the only way to set

'innodb_buffer_pool_size'

'innodb_buffer_pool_size'

变量是通过将其写入[mysqld]部分下的 myf(对于Linux)和 my.ini(对于Windows)来实现的:

variable was by writing it to myf (for linux) and my.ini (for windows) under [mysqld] section :

[mysqld] innodb_buffer_pool_size = 2147483648

您需要重新启动mysql服务器才能生效.

从MySQL 5.7.5开始,innodb_buffer_pool_size配置选项 可以使用SET语句动态设置,允许您调整大小 缓冲池,而无需重新启动服务器.例如:

As of MySQL 5.7.5, the innodb_buffer_pool_size configuration option can be set dynamically using a SET statement, allowing you to resize the buffer pool without restarting the server. For example: mysql> SET GLOBAL innodb_buffer_pool_size=402653184;

参考文献: dev.mysql/doc/refman/5.7/en/innodb-buffer-pool-online-resize.html

缓冲池大小必须始终等于或倍数 innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances.如果你 将innodb_buffer_pool_size配置为不等于或 innodb_buffer_pool_chunk_size的倍数* innodb_buffer_pool_instances,缓冲池大小自动 调整为等于或倍数的值 innodb_buffer_pool_chunk_size *即innodb_buffer_pool_instances 不小于指定的缓冲池

Buffer pool size must always be equal to or a multiple of innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances. If you configure innodb_buffer_pool_size to a value that is not equal to or a multiple of innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances, buffer pool size is automatically adjusted to a value that is equal to or a multiple of innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances that is not less than the specified buffer pool

通过@FlyingAtom

更多推荐

如何设置全局innodb

本文发布于:2023-10-28 10:29:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536383.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:全局   如何设置   innodb

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!