Mysql startup failure common errors, mysql failure Common Errors
You can take an error one by one in sequence.
Mysql startup ERROR: Starting MySQL... ERROR! The server quit without updating PID file (/opt/mysql-master/data/mysql. pid) solution:
1. It may be that the/opt/mysql-master/data DIRECTORY mysql user does not have the permission to modify the data directory)
Solution: grant permissions, execute "chown-R mysql. mysql/opt/mysql-master/data", and restart mysqld.
2. the mysql process may already exist in the process.
Solution: Run "ps-ef | grep mysqld" to check whether the mysqld process exists. If the "kill-9 process number" is used to kill the process and restart mysqld!
3. mysql may be installed on the machine for the second time. The Service Startup may be affected due to residual data.
Solution: Go to the mysql binary log directory to see if there is a mysql-binlog.index, just remove it
4. mysql uses the/etc/my. cnf configuration file when the configuration file is not specified at startup. Open this file to see if there is a specified data directory (datadir) under [mysqld ).
Solution: Set this line in [mysqld]: datadir =/opt/mysql-master/data
5. skip-federated Field Problems
Solution: Check whether the skip-federated field has been commented out in the/etc/my. cnf file. If so, comment out the field immediately.
6. The error log directory does not exist.
Solution: use the "chown" "chmod" command to grant the mysql owner and permissions.
7. selinux. If it is a centos system, selinux is enabled by default.
Solution: temporarily change to warning mode: [root @ www php] # setenforce 0
Enable/etc/sysconfig/selinux and change SELINUX = enforcing to SELINUX = disabled.
8. You can try to enable the default mysql. cnf file to check whether the configuration file is incorrect.
Common configuration errors include:
Check whether innodb_buffer_pool_size is specified in the/etc/my. cnf configuration file.
Innodb_buffer_pool_size: Mainly used to cache indexes, data, and buffer when inserting data in the innodb table;
Default Value: 128 M;
Set the size of this value for a dedicated mysql Server: 70%-80% of the system memory.
If your system memory is not large, check this parameter and set it to a smaller value.
Tip: Remember to enable the mysql error log for troubleshooting.
Vim/etc/my. cnf can be edited based on your my. cnf file.
[Mysql_safe]
Log-error =/data/mysql-master/logs/error. log