Perfect solution to MySQL common insufficient memory startup failure

Perfect solution to MySQL common insufficient memory startup failure

1. If MySQL is not started successfully, 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' registration as a STORAGE ENGINE failed.
[ERROR] Failed to initialize plugins.
[ERROR] Aborting

3. After querying, it is because of insufficient memory. Check the memory

Increase the swap space to solve the problem:

dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile 


4. Add automatic mounting:

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

service mysql start Started successfully

5. Notes:

Generate an empty file

dd if=/dev/zero of=1.txt bs=1M count=2 Generate an empty file of a specified size if=filename: input filename of=filename: output filename bs=byte size count=number

Summarize

The above is the perfect solution to the common MySQL startup failure due to insufficient memory that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Detailed explanation of memory management of MySQL InnoDB storage engine
  • Detailed analysis of MySQL 8.0 memory consumption
  • Detailed explanation of the usage of MySQL memory tables and temporary tables
  • Solutions to MySQL OOM (memory overflow)
  • Detailed explanation of how to view MySQL memory usage
  • Test and solution for MySQL's large memory usage and high CPU usage
  • Solution to high memory usage when starting MySQL 5.6
  • Share the process of troubleshooting abnormal memory increase in MySQL production database

<<:  Linux configuration SSH password-free login "ssh-keygen" basic usage

>>:  Some details about semicolons in JavaScript

Recommend

TABLE tags (TAGS) detailed introduction

Basic syntax of the table <table>...</tab...

How to submit the value of a disabled form field in a form Example code

If a form field in a form is set to disabled, the ...

JavaScript Shorthand Tips

Table of contents 1. Merge arrays 2. Merge arrays...

Solve the error during connect exception in Docker

When you first start using Docker, you will inevi...

Discussion on the Issues of Image Button Submission and Form Repeated Submission

In many cases, in order to beautify the form, the ...

Detailed explanation of soft links and hard links in Linux

Table of contents 1. Basic storage of files and d...

Introduction to the use of http-equiv attribute in meta tag

meta is an auxiliary tag in the head area of ​​htm...

Tutorial on resetting the root password of Mac MySQL

Disclaimer: This password reset method can direct...

Pure CSS to implement iOS style open and close selection box function

1 Effect Demo address: https://www.albertyy.com/2...

Docker Data Storage Volumes Detailed Explanation

By default, the reading and writing of container ...

Detailed explanation of views in MySQL

view: Views in MySQL have many similarities with ...

Mysql query the most recent record of the sql statement (optimization)

The worst option is to sort the results by time a...

Vue implements login verification code

This article example shares the specific code of ...

Install mysql5.7 on Ubuntu 18.04

Ubuntu 18.04 installs mysql 5.7 for your referenc...