There are a number of reasons why MySQL cannot be started, and here is a situation and workaround that I have encountered.
Cause:
Recently the project needs to use MySQL, and then want to install a local database on the Mac, but actually forgot to install a version, the results found that the new server can not run.
Phenomenon:
Starting mysql:sudo/usr/local/mysql/support-files/mysql.server start from the command line
Starting MySQL
Always get this error:
error! The server quit without updating PID file (/usr/local/mysql/data/localhost.pid).
To view the error file:
sudo tail/usr/local/mysql/data/localhost.err
The results are as follows:
2014-06-24 13:50:52 37094[Note]shutting down plugin ' MyISAM '2014-06-24 13:50:52 37094[Note]shutting down plugin ' MEMORY '2014-06-24 13:50:52 37094[Note]shutting down plugin ' CSV '2014-06-24 13:50:52 37094[Note]shutting down plugin ' Sha256_password '2014-06-24 13:50:52 37094[Note]shutting down plugin ' Mysql_old_password '2014-06-24 13:50:52 37094[Note]shutting down plugin ' Mysql_native_password '2014-06-24 13:50:52 37094[Note]shutting down plugin ' Binlog '2014-06-24 13:50:52 37094[Note]/usr/local/mysql/bin/mysqld:shutdown Complete140624 13:50:52 mysqld_safe mysqld from PID File/usr/local/mysql/data/localhost.pid ended
The MySQL process is suspected to exist.
Workaround:
Find all MySQL-related processes by command: Ps-ef|grep MySQL
Then kill the process: sudo kill-9 PID
------------a successful split line----------------
Last Run command: Sudo/usr/local/mysql/support-files/mysql.server start
Get success! results.