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):
innodb_buffer_pool_size
You should set this variable value under [mysqld] section as :
innodb_buffer_pool_size=2G
and restart MySQL service to have effect.
InnoDB buffer pool caches both data and index pages. You can set this value to 70-80% of available memory for Innodb-only installations
Look here innodb_buffer_pool_size documentation
In there it says this variable can be set in option-file (my.cnf) or on the command line when starting the server.
Also. I don't think you'll be able to assign the value of "system display" to this variable as it is a numeric. See the docs.
I faced that same problem:
ERROR 1238 (HY000): Variable 'innodb_buffer_pool_size' is a read only variable
Then I notice I wrote [mysqly]
wrongly at the top, and that's why my.cnf was not working properly. I change it to [mysqld]
and restart MySQL, then everything is working perfectly.
In the earlier versions of MySQL ( < 5.7.5 ) the only way to set
'innodb_buffer_pool_size'
variable was by writing it to my.cnf (for linux) and my.ini (for windows) under [mysqld] section :
[mysqld]
innodb_buffer_pool_size = 2147483648
You need to restart your mysql server to have it's effect in action.
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;
Reference : http://dev.mysql.com/doc/refman/5.7/en/innodb-buffer-pool-online-resize.html
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
By @FlyingAtom
You could do something like this from mysql command line / mysql workbench
SET GLOBAL innodb_buffer_pool_size= (SELECT @@innodb_buffer_pool_size)*10
#check via this:
#SELECT @@innodb_buffer_pool_size/1024/1024/1024