3
3

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.

MySQL5.7を起動時に起こるエラー「ERROR! The server quit without updating PID file」に関して

Posted at

##はじめに
MacOS内にMySQL8.0が入っていたが、MySQL5.7にダウングレードする必要があり、
MySQL8.0を完全にアンインストール後にMySQL5.7をHomebrewでインストールした。

しかし、MySQLサーバー起動時に「ERROR! The server quit without updating PID file」というエラーが出て起動できなかったので、その解決方を忘備録として残しておきます。

##開発環境

Center align Center align
MacOS Mojave 10.14.6
Mysql 5.7.29

##MySQL5.7のインストール
MacOS内にもともと入っていたMySQL8.0はこの記事を参考に削除したという前提でMySQL5.7をインストール

$ brew install mysql@5.7

$ vim .bash_profile

# .bash_profileに下記の一行を追加
export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"

# .bash_profileの再読み込み
$ source .bash_profile

$ mysql.server start
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/ip-10-3-4-134.ap-northeast-1.compute.internal.pid).

##解決方法

my.cnfファイルにskip-grant-tablesを追加したら、無事に起動しました。

$ vim /usr/local/etc/my.cnf

# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
#mysqlx-bind-address = 127.0.0.1
#socket=/tmp/mysql.sock
skip-grant-tables  ←追記

$ mysql.server start                                                                                                                                                                              
Starting MySQL
. SUCCESS!

無事解決!!!

##参考
MacでMySQL5.7をアンインストールする
MySQL5.7をHomebrewでmacOSにインストールする手順

3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?