如何设置全局innodb_buffer_pool_size? [英] How to set global innodb_buffer_pool_size?

查看:319
本文介绍了如何设置全局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]部分下的 my.cnf(对于Linux) my.ini(对于Windows)来实现的:

variable was by writing it to my.cnf (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;

参考文献: http://dev.mysql.com/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_buffer_pool_size?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆