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

MySQL 接続エラー 

Last updated at Posted at 2020-06-12

概要

環境構築の際にMySQLのエラーがよく起きるので備忘録を残します。

エラー

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (38)

この辺りはよく見かけるエラーでQiitaでもたくさん解決法が載っていました。

https://qiita.com/hondy12345/items/d32ed749fb49e9da7de6
https://qiita.com/masa_stone22/items/38a286a89c309de7d44e

それでも解決しなかった。
特にこんなエラーがでてくるという場合は

The server quit without updating PID file

プロセスを一度キルすると動きました。

$ ps aux | grep mysql プロセス表示
$ kill プロセス
$ mysql.server start 再度起動させる

それでも治らなかったらbrew uninstallしてbrew installし直すと良いみたいです。
brew installする時バージョン指定をしていないと最新のバージョンがインストールされてしまうので注意してください。

以上です!

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?