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

mysql.server startの際にエラーがでてしまった時に解決した方法

0
Posted at

mysqlをHomebrew経由でMacへダウンロードします。

$ brew install mysql

日本語化設定と暗号化プラグインの設定に関しては省略します。
mysqlを起動します。

$ mysql.server start

本来はここで

Starting MySQL
. SUCCESS!

と出ればインストールが完了するのですが私の場合

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

とでました。
色々と検索したところ、ユーザーの権限の問題があり権限を変更すれば解決することができたという記事を見かけましたが私も色々試しましたのですが解決することができませんでした。
しかし、MySQLのデータファイルやログなどが格納されているディレクトリを削除するという方法で解決することができました。

# MySQLのデータファイルやログなどが格納されているディレクトリを削除する
$ sudo rm -rf /usr/local/var/mysql 
# MySQLを再インストール
$ brew uninstall mysql
$ brew install mysql
# MySQLを起動
$ mysql.server start
Starting MySQL
SUCCESS!

mysql無事起動成功しました。

参考までに引用リンクを記載しておきます。

https://reasonable-code.com/mysql-start-error/

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