Mysql cannot start -- cannot allocate the memory for the buffer pool, allocatebuffer
Today, the development website is suddenly unavailable. When the Mysql database is down, restart it:
mysql.server restart
"Manager of pid-file quit without updating file" is always reported ".
Then, find out the cause. There are three problems on the Internet:
1. The hard disk is insufficient to write pid files.
2. The process is stuck. Find the mysql process and kill it and restart it.
3. for directory permission issues, find the directory written to the pid file and check whether the directory permission is the user specified to install mysql.
The above is the most common solution to this problem, but I tried it and it didn't work. So I checked the mysql. err error log file:
tail -100 mysql.err
The following error is found:
It can be seen that mysql cannot be started because of insufficient memory:
Cannot allocate the memory for the buffer pool
Then I checked the memory:
free -ml
It was found that there were indeed not enough, and there were only more than 300 M left. Therefore, first kill some other useless processes on the machine and then modify my. in the cnf configuration file, the following two fields are found: Change the former from 2g to 200 M, and change the latter to 120 M.
innodb_buffer_pool_size=200Mkey_buffer=120M
Then restart Mysql.
The mysql service cannot be started. The following is the mysql error log.
1. Pay attention to storage engine errors
Unknown/unsupported storage engine: InnoDB
2. Check the innodb parameter in the configuration file. If skip-innodb has been commented out
3. If innodb_log_file_size is reset, delete several ib_logfiles and restart the database.
Failed to start mysql in linux
Check whether/etc/my. cnf is incorrect.