0
1

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 3 years have passed since last update.

【Mac】MySQLが起動しない (ERROR! The server quit without updating PID file)

Posted at

症状

開発マシンの調子が悪いので再起動したが、それからMacのMySQLが起動しない。

$ sudo mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/my-host.pid).

$ sudo mysql.server restart                                                                                                                                                              127 ↵
 ERROR! MySQL server PID file could not be found!
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/my-host.pid).

試行錯誤

とりあえずMySQLのプロセスが動いているか見て、動いていればプロセスを止める。

ps aux | grep mysql
kill -9 mysqlのPID / mysqld_safeのPID

MySQLのエラーログを見る。

$ sudo less /usr/local/var/mysql/my-host.err

中略

[ERROR] [MY-010274] [Server] Could not open unix socket lock file /tmp/mysql.sock.lock.
[ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
[ERROR] [MY-010119] [Server] Aborting

mysql.sock.lock の読み書きで問題があるらしい。
移動(削除)してあげよう。

sudo mv /tmp/mysql.sock.lock /tmp/mysql.sock.lock.old

再挑戦。

$ sudo mysql.server start
Starting MySQL
. SUCCESS!

起動成功!

結構悩んだのに、そんなんでいいんかい!🧐

0
1
0

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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?