MySQL startup error: The server quit without updating PID file problem
If the database reports this error, there is no error in the log, and the configuration file and directory permissions are in line, you can use the following command to check whether the dependency file is missing.
- 1、/usr/local/mysql/bin/mysqld -V
- 2. Check whether the configuration file encoding has changed, replace a normal configuration file and restart the test
1. Directory permission issues
Authorize the installation directory and data directory of mysql respectively
# chown -R /usr/local/mysql # chown -R /data/mysql # service mysqld start
Or it is caused by configuration items in the configuration file, and the modified configuration is backed. This error can be displayed in the database error log.
2. The mysql process may already exist in the process
Solution:
Use the command "ps -ef|grep mysqld" to check whether there is a mysqld process
If you use "kill -9 process number" to kill, then restart mysqld!
3. It may be the second time I installed mysql on the machine
Residual data affects the service startup
Solution:
Go to the mysql data directory/data to see. If it exists, delete it as soon as possible, it is the culprit.
/etc/ configuration file is used when no configuration file is specified at startup
Please open this file to see if there is a specified data directory (datadir) under the [mysqld] section.
Solution:
Please set this line under [mysqld]: datadir = /usr/local/mysql/data
5. It may be that the /usr/local/mysql/data/ file does not have permission to write
Solution:
Give permissions, execute "chown -R mysql:mysql /var/data" "chmod -R 755 /usr/local/mysql/data" and restart mysqld!
If it is a centos system, selinux will be enabled by default.
Solution:
Close it, turn on /etc/selinux/config, change SELINUX=enforcing to SELINUX=disabled, save the disk and exit the restart machine.
7. Delete the "ib_*" file in mysql library file /data/mysql/
Note: ** You must back up the database before performing this operation, because ibdata1 stores all data files. If the library is accidentally deleted, it will be miserable! ! ! (The legendary thing is from deleting the library to running away...), and then restart mysql.
8. The following error prompts are shown in the log
Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed。
Solution:
[root@localhost mysql]# rm -rf ib_logfile*
Then start mysql and the problem is solved!
9. There are words like this when reading the log
“initialize buffer pool,size=128.0M”,“cannot allocate memory for the pool”
It roughly means that enough memory cannot be allocated for pool use.
At this time, I thought of the related configuration in the mysql configuration file, so I changed the following parameters:
innodb_buffer_pool_size = 128 #This value in the configuration file defaults to128M
Reduce this value and start the mysql service again to solve the problem!
10. MySQL dependency file is missing on the system
# yum -y install libaio # yum -y install numactl
Restart mysql service, problem solved
Summarize
The above is personal experience. I hope you can give you a reference and I hope you can support me more.