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