11
8

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 MySQL8.0 ERROR! MySQL server PID file could not be found!

Posted at

Mac MySQL 8.0 再インストールする からエラー部分だけ切り出してエラーの対策方法をご紹介します。

環境

  • macOS Catalina 10.15.4
  • Homebrew 2.2.14
  • MySQL 8.0.19

エラー

$ mysql.server start
 ERROR! MySQL server PID file could not be found!
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/var/mysql/[PC名].local.pid).

エラー内容の確認

MySQLの起動に失敗した場合は下記のエラーログファイルを確認します。

$ less /usr/local/var/mysql/$(uname -n).err

2020-05-02T11:56:47.171263Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2020-05-02T11:56:47.171446Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2020-05-02T11:56:47.171788Z 0 [ERROR] [MY-010119] [Server] Aborting

このエラーはすでに 3306 ポートが使われているというエラーです。

$ lsof -i:3306
COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
mysqld  36074 ucan   27u  IPv4 0xbab6ad8ffa0d4ac3      0t0  TCP localhost:mysql (LISTEN)

MySQLのプロセスが残っていることを確認しました。
kill コマンドでプロセスを削除します。

$ kill `lsof -ti:3306`

MySQLが起動できればokです。

$ mysql.server start
Starting MySQL
. SUCCESS!
11
8
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
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?