Mysql startup error The server quit without updating PID

[root@db mysql]# service mysql restart
MySQL server PID file could not be found![失败]
Starting MySQL...The server quit without updating PID file (/usr/local/mysql/data/snsgou.pid).[失败]

 


Under Google, there may be several reasons for the problem, the specific reasons the best way is to view the error log:
1, may be /usr/local/mysql/data/mysql.pid file does not have write permission
Solution: give permission, the implementation of "chown -R mysql: mysql / var / data" "chmod -R 755 / usr / local / mysql / data" and then restart mysqld!

2, the process may already exist mysql process
Workaround: use the command "ps -ef | grep mysqld" to see if there mysqld process, if you are using "kill -9 process ID to" kill, then restart mysqld!

3, may be the second time to install mysql on the machine, residual data affected the start of the service.
Solution: mysql data directory to / data to see if there is mysql-bin.index, then quickly delete it right, it is the culprit. Article I is to use the solution!

4, uses the configuration file mysql /etc/my.cnf not specify the configuration file at startup, open the file to view in the [mysqld] section has not specified data directory (datadir).
Solution: You can add this line [mysqld] at: datadir = / usr / local / MySQL / the Data

5, Skip-field problems Federated
Solution: Check /etc/my.cnf file has not been commented out no skip-federated field, if you have commented on it immediately.

6, the error log directory does not exist
Workaround: Use the "chown" "chmod" command and authority conferred mysql owner

7, selinux to blame, if the system is centos default will open selinux
solution: turn it off, open / etc / selinux / config, the SELINUX = enforcing changed after SELINUX = disabled Save and exit to try to restart the machine.

Guess you like

Origin www.cnblogs.com/guipeng/p/11828516.html