[Daily] MySQL memory failure solution, mysql Solution
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/swapfileswapon/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