How to dynamically modify innodb_buffer_pool_size online in MySQL5.7
This article shows you how to dynamically modify innodb_buffer_pool_size online in MySQL5.7. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
In previous versions of MySQL5.7, innodb_buffer_pool_size could not be modified online and could only be modified by restarting the MySQL process. MySQL5.7 begins to be able to dynamically modify its size online.
In the MySQL5.6 test environment:
Click (here) to collapse or open
Mysql > select version ()
| | version () |
| | 5.6.36 |
View innodb_buffer_pool_size size
Click (here) to collapse or open
Mysql > show variables like 'innodb_buffer_pool_size'
| | Variable_name | Value |
| | innodb_buffer_pool_size | 134217728 | |
Modify innodb_buffer_pool_size size
Click (here) to collapse or open
In the MySQL5.7 test environment:
Mysql > set global innodb_buffer_pool_size=500*1024*1024
ERROR 1238 (HY000): Variable 'innodb_buffer_pool_size' is a read only variable
Click (here) to collapse or open
Mysql > show variables like 'innodb_buffer_pool_size'
+-+ +
| | Variable_name | Value |
+-+ +
| | innodb_buffer_pool_size | 536870912 | |
+-+ +
Modify the innodb_buffer_pool_size size:
Click (here) to collapse or open
View the innodb_buffer_pool_size size:
Click (here) to collapse or open
Mysql > set global innodb_buffer_pool_size=800*1024*1024
Query OK, 0 rows affected, 1 warning (0.00 sec)
Mysql > show variables like 'innodb_buffer_pool_size'
+-+ +
| | Variable_name | Value |
+-+ +
| | innodb_buffer_pool_size | 939524096 | |
+-+ +
Mysql > select version ()
+-+
| | version () |
+-+
| | 5.7.18-log |
+-+
View the current innodb_buffer_pool_size size.
The above is how to dynamically modify innodb_buffer_pool_size online in MySQL5.7. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.