大网数据广告活动
服务器运维问答

How to permanently increase innodb_buffer_pool_size on Ubuntu

· 52CE 我爱测

I have read lot of posts & manuals to try to find out how to increase memory in MySQL 5.6 on Ubuntu, which say there are 3 methods: By editing innodb_buffer_pool_size in the my.cnf By command line option on starting MySQL Dynamic…

问题原文

原帖链接 · eos · CC BY-SA 4.0

I have read lot of posts & manuals to try to find out how to increase memory in MySQL 5.6 on Ubuntu, which say there are 3 methods:

  1. By editing innodb_buffer_pool_size in the my.cnf
  2. By command line option on starting MySQL
  3. Dynamically with SQL commands.

I assume 2 and 3 will be lost when MySQL is restarted, which leaves 1.

The problem is, there are no such settings in my /etc/mysql/my.conf.

The string "inno" does not exist in the conf file, nor does "buffer_size" or "buffer-size" (but "key_buffer" is in there).

I installed it via:

# apt-get install mysql-server-5.6 

Any ideas where I can change the value?

Did I somehow install MySQL without the InnoDB engine?

Am I looking in the wrong file?

There are some other .cnf files under /etc/mysql, but they have nothing like innodb in them either.

mysql> show variables like 'inno%'
:
innodb_buffer_pool_size                  | 134217728              |

So it looks like InnoDB is installed, I just can't find where its config file is.

Any help appreciated.

已采纳解答

原帖链接 · FlyingZebra1 · CC BY-SA 4.0

Here's what worked for me (ubuntu 19, mysql 8):

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

add in this at the bottom of the file

innodb_buffer_pool_size        = 8G

save and exit. restart MySQL.

sudo systemctl restart mysql

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-01-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。