LoginSignup
9
11

More than 5 years have passed since last update.

HomebrewでMySQLをインストールしたときのエラー

Last updated at Posted at 2015-12-04

HomebrewでMySQLのインストールを行ったときに遭遇したエラーについてまとめてみました。

Homebrewのインストール

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
上記のコマンドを実行するとインストールがはじまる

MySQLのインストール

brew install mysql
これでmysqlのインストールがはじまる

mysql.serverの起動

sudo mysql.server start
root権限でmysql.serverを起動

しかし、
$sudo mysql.server start
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/***.local.pid).

となり起動に失敗する

いろいろ調べてみるとどうやら権限に問題があるらしい
/usr/local/var/mysql/の権限をいじる
所有者を_mysqlに変更
sudo chown -R _mysql /usr/local/var/mysql
アクセス権限を全ユーザに与えてみる
sudo chmod 777 /usr/local/var/mysql

もう一度試してみる
$sudo mysql.server start
Starting MySQL
. SUCCESS!

これで上手くいった

参考

MySQLが起動しないエラー
Macの電源を久しぶりに落としたらmysqlが起動しなくなった

9
11
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
9
11