如何设置全局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
发布评论