Tag Archives: mmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool

mysqlmmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool

Why can’t you stop buying 618?From the technical dimension to explore>>>

After starting MySQL in the way of ‘systemctl start mysqld. Service’ for a period of time, it was found that it could not be started suddenly, and trying to restart it could not solve the problem. When troubleshooting the problem, the command ‘systemctl status mysqld. Service’ and ‘journalctl – Xe’ were used to check the problem, but there was no result. After checking ‘/ var/log/mysqld. Log’, it was found that the error information in the log was as follows:

2019-02-07T00:33:21.731341Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 1

28M

2019-02-07T00:33:21.731439Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12

2019-02-07T00:33:21.731450Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool

2019-02-07T00:33:21.731464Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error

2019-02-07T00:33:21.731477Z 0 [ERROR] Plugin ‘InnoDB’ init function returned error.

2019-02-07T00:33:21.731483Z 0 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.

2019-02-07T00:33:21.731489Z 0 [ERROR] Failed to initialize builtin plugins.

2019-02-07T00:33:21.731493Z 0 [ERROR] Aborting

Looking up the information on the Internet, some people say that swap is not enough. Using the ‘free’ command to check, it is found that the spare swap is indeed 0, but it is very strange that the spare swap I bought for vultr and ECS using ‘free’ is 0. So why did the MySQL service deployed by vultr hang up and ECS not?Later, I used the command ‘sudo DD if =/dev/zero of =/swapfile BS = 1m count = 1024’ to add swap and found that it didn’t work. My spare swap was still 0

Looking at the data, some people said that in the “my. CNF”, the “InnoDB” would be changed_ buffer_ pool_ Open the comment, restart the service, and report an error

Later, I used the InnoDB in my. CNF_ buffer_ pool_ Size = 64M ‘is lowered to 64M, and then the service is restarted. MySQL starts successfully

Conclusion: my server configuration may be low, which makes the normal ‘initializing buffer pool = 128’ of mysql5.7 unable to be allocated successfully. Just reduce the configuration
`

question 2: changed limits: Max_ open_ files: 5000 (requested 5010)

Whether the command ‘ulimit – n’ is restricted by the Linux system

Check the ‘limitnofile’ under ‘VIM/usr/lib/SYSTEMd/system/mysqld. Service’ to see if there is a 5000 limit. Just adjust it to 65535

Reference [here]( http://blog.itpub.net/20893244/viewspace-2152685/ )

problem 3: Alibaba cloud server MySQL is a perfect solution to automatically stop hanging up and restart

Solution: [here]( https://blog.csdn.net/xuz0917/article/details/79100834 )

[here]( https://jingyan.baidu.com/article/da1091fb032cad027949d64e.html )

problem 4: IP address’ x.x.x.x ‘could not be resolved: name or service not known

solution: [here]( https://www.jb51.net/article/70893.htm )

Configure ‘skip name resolve’ in ‘my. CNF’
file`

Question 5: got error: 1045: access denied for user ‘root’ @’localhost ‘ ( using password: )

Solution: Remove ‘skip name resolve’ from ‘my. CNF’

Liu Shi’s Novels