InnoDB: Cannot allocate memory for the buffer pool

本文记录了在Ubuntu上启动MySQL失败的问题,通过查看错误日志和系统内存使用情况,发现是由于内存不足导致的。解决方案是关闭不必要的服务(如uwsgi),释放内存后重启MySQL,成功解决了启动问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ubuntu启动mysql失败

1、启动命令

sudo /etc/init.d/mysql restart

显示:

[....] Restarting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
 failed!

2、查看原因

输入:

systemctl status mysql.service

显示:

Apr 20 12:04:40 hecs-x-medium-2-linux-20200331093041 systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 20 12:04:40 hecs-x-medium-2-linux-20200331093041 systemd[1]: Failed to start MySQL Community Server.
Apr 20 12:04:40 hecs-x-medium-2-linux-20200331093041 systemd[
sudo cat /usr/local/mysql/data/VM-16-9-centos.err 2025-03-20T02:00:15.739959Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-03-20T02:00:15.740032Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2025-03-20T02:00:15.740057Z 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.7.36) starting as process 813856 ... 2025-03-20T02:00:15.747664Z 0 [Note] InnoDB: PUNCH HOLE support available 2025-03-20T02:00:15.747684Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2025-03-20T02:00:15.747688Z 0 [Note] InnoDB: Uses event mutexes 2025-03-20T02:00:15.747691Z 0 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier 2025-03-20T02:00:15.747695Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2025-03-20T02:00:15.747698Z 0 [Note] InnoDB: Using Linux native AIO 2025-03-20T02:00:15.747921Z 0 [Note] InnoDB: Number of pools: 1 2025-03-20T02:00:15.748013Z 0 [Note] InnoDB: Using CPU crc32 instructions 2025-03-20T02:00:15.749664Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2025-03-20T02:00:15.758255Z 0 [Note] InnoDB: Completed initialization of buffer pool 2025-03-20T02:00:15.760782Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2025-03-20T02:00:15.772580Z 0 [Note] InnoDB: Highest supported file format is Barracuda. 2025-03-20T02:00:15.783164Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2025-03-20T02:00:15.783219Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2025-03-20T02:00:15.815854Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. 2025-03-20T02:00:15.816646Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
最新发布
03-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

东木月

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值