38
33

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MySQLがERROR! The server quit without updating PID fileで起動できないときにやったこと

Posted at

事象

Mac OS XでMySQLを起動しようとしたところ、エラーで起動できない。
(MySQLはbrew経由でインストール)

コンソールのエラーメッセージ

mysql.server start
... ERROR! The server quit without updating PID file [ディレクトリパス].

結論

/tmp/mysql.sockの削除で解消。

やったこと

エラーログ見る

$ tail -f /usr/local/var/mysql/[マシン名].local.err

参考:http://easyramble.com/mysql-server-pid-file-error.html

結果

Can't start server : Bind on unix socket: Address already in use
Do you already have another mysqld server running on socket: /tmp/mysql.sock ?

他のMySQL動いてね?と言われるのでプロセス見にいく

プロセスをチェック

$ ps aux |grep mysql

結果

プロセスはなし。一応ポートも見にいく。

参考:http://stackoverflow.com/questions/14179434/mysql-service-does-not-startaddress-already-in-use

ポートが空いてるか確認

$ netstat -na | grep LISTEN

or

$ sudo lsof -i :3306

結果

3306(MySQLのデフォルト)は空いてた。

/tmp/mysql.sockを削除

$ rm /tmp/mysql.sock

参考:http://iainbarnett.me.uk/articles/mysql-cant-start-server/

結果

解決。

38
33
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
38
33

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?