Mysql – Permanent solution for Fixing buffer size

buffer-poolinnodbMySQLmysql-5.7

I have installed MySQL 5.7 on windows server 2016 and set the buffer pool size to 4 GB through SQL query but when the server is restarted buffer pool size getting reduced resulting in the slowness of application hosted on it … need suggestion so as to permanently fix the buffer pool size…..

Best Answer

To find the slowness of the application, we need to dig deeper on many other aspects, such as table design, query, indexes, data type, etc...

To set the innodb_buffer_pool_size value to 4 GB, edit the configuration file my.ini and add the following statement, then restart the MySQL server:

[mysqld]
innodb_buffer_pool_size = 4G

Or you can set it online (restart not required) by running the following statement:

SET GLOBAL innodb_buffer_pool_size = 1024 * 1024 * 1024 * 4;

There are few things to consider, before changing this variable. My blog post contains the detailed explanation on allocating innodb_buffer_pool_size.