2

I need to increase MySql memory for innodb but i cannot find the variable "innodb_buffer_pool_size". I have Ubuntu 18.04 installed and MySQL 5.7 In stackoverflow, some posts says to modify the my.cnf file and increase the variable "innodb_buffer_pool_size", but I don't find the variable.

In my Ubuntu server, here is my my.cnf file (etc/mysql/my.cnf):

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

This is my /etc/mysql/conf.d/mysql.cnf

[mysql]

And this is /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
datadir     = /var/lib/mysql
log-error   = /var/log/mysql/error.log
# By default we only accept connections from localhost
bind-address = *
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
default_password_lifetime = 0

1 Answer 1

2

Not every config variable is in the file.

Variables that are not present in the file are given a default value that is compiled into the mysqld binary.

In the case of innodb_buffer_pool_size, the default is 134217728 (see https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_buffer_pool_size).

To set a non-default value, you must add a line to one of the config files.

You may also want to create a new config file for your local config customizations. You can put the file under either of the .d directories named in the !includedir directives. If you create a new config file, remember to put the setting under the option heading [mysqld].

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you @Bill Karwin,This is the first time I modify mysql confg files. I need to increase memory until 2GiB. is this correct? "innodb_buffer_pool_size=2097152" into /etc/mysql/mysql.conf.d/mysqld.cnf.
That would work. You can also shorten it to innodb_buffer_pool_size=2G which is a bit easier. Remember to restart the mysql server daemon after editing the config file. In the case of buffer pool size, in MySQL 5.7 and later you can change it without restarting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.