Home > Database > Mysql Tutorial > body text

How to solve MySQL startup failure due to insufficient memory

王林
Release: 2023-05-31 20:16:04
forward
2011 people have browsed it

How to solve MySQL startup failure due to insufficient memory

1. It has been unsuccessful when starting MySQL. Check the error log /var/log/mysql/error.log

How to solve MySQL startup failure due to insufficient memory

2. The main error messages are as follows: /var/log/mysql/error.log

[ERROR] InnoDB: mmap(136151040 bytes) failed; errno 12
[ERROR] InnoDB: Cannot allocate memory for the buffer pool
[ERROR] InnoDB: Plugin initialization aborted with error Generic error
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Failed to initialize plugins.
[ERROR] Aborting
Copy after login

3. After querying, it is due to insufficient memory. Check the memory: /var/log/mysql/error .log

How to solve MySQL startup failure due to insufficient memory

Increase swap space to solve the problem:

dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile
Copy after login
How to solve MySQL startup failure due to insufficient memory

4. Add automatic mounting: /var/ log/mysql/error.log

在文件/etc/fstab中加入 /swapfile swap swap defaults 0 0

service mysql start 启动成功
Copy after login

5. Note: Generate empty file

dd if=/dev/zero of=1.txt bs=1M count=2 生成一个指定大小的空文件if=文件名:输入文件名
of=文件名:输出文件名
bs=字节大小
count=个数
Copy after login

The above is the detailed content of How to solve MySQL startup failure due to insufficient memory. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template