Solution to MySQL startup failure due to insufficient memory

Source: Internet
Author: User

Solution to MySQL startup failure due to insufficient memory

1. Failed to start MySQL. Check the error log/var/log/mysql/error. log.

2. The main error messages are as follows:

[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' registry as a storage engine failed.
[ERROR] Failed to initialize plugins.
[ERROR] Aborting

3. Check the memory because the memory is insufficient.

Add swap space to solve the problem:

Dd if =/dev/zero of =/swapfile bs = 1 M count = 1024
Mkswap/swapfile
Swapon/swapfile

4. Add automatic mounting:

Add/swapfile swap defaults 0 0 to the/etc/fstab file

Service mysql start started successfully

5. Remarks:

Generate an empty file

Dd if =/dev/zero of1_1.txt bs = 1 M count = 2 generate an empty file of the specified size
If = File Name: Input File Name
Of = File Name: output file name
Bs = byte size
Count = count

This article permanently updates link: https://www.bkjia.com/Linux/2018-03/151366.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.