1
0

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.

【MySQL5.7】MySQLが、思うように立ち上がらない。。。

Posted at

環境

$ mysql --version
mysql  Ver 14.14 Distrib 5.7.29, for osx10.15 (x86_64) using  EditLine wrapper

PIDファイルに関してのエラー

$ mysql.server start

ERROR! The server quit without updating PID file (/usr/local/var/mysql/hogehogenoMacBook-Pro.local.pid).

マシンのホスト名を確認

$ uname -n
hogehogenoMacBook-Pro.local

pidファイルを作成し、アクセス権限を付与

$ sudo touch /usr/local/var/mysql/hogehogenoMacBook-Pro.local.pid

# /usr/local/var/mysql/配下のファイルにアクセス権限を付与する
$ sudo chown -R _mysql:_mysql /usr/local/var/mysql/

もう一度、MySQLを起動する

$ mysql.server start

Starting MySQL
. SUCCESS! 

それでも、エラーになる場合

ERROR! The server quit without updating PID file (/usr/local/var/mysql/hogehogenoMacBook-Pro.local.pid).

プロセス関連のエラー

mysqldのプロセスが既に起動していたら、プロセスIDを指定してkillする

$ ps -ef | grep mysql

    0  1435     1   0  3:46PM ??         0:00.02 /bin/sh/usr/local/Cellar/mysql@5.7/5.7.29/bin/mysqld_safe

   74  1531     1   0  3:46PM ??         0:08.23 /usr/local/Cellar/mysql@5.7/5.7.29/bin/mysqld

$ sudo kill -9 1435
$ sudo kill -9 1531

もう一度、pidファイルを作成し権限を与え、起動する

$ sudo touch /usr/local/var/mysql/hogehogenoMacBook-Pro.local.pid
$ sudo chown -R _mysql:_mysql /usr/local/var/mysql/

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?