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?

【Laravel】SQLSTATE[HY000] [2002] Connection refused の解消方法

Last updated at Posted at 2024-11-18

取るべき初動

まずはプロジェクトディレクトリの.env ファイルにおいて、以下の環境変数が正しく設定されているか確認してください。

DB_HOST
DB_PORT
DB_DATABASE
DB_USERNAME
DB_PASSWORD 

これら値が誤っていると、Laravel がデータベースに接続できずConnection refusedエラーとなる場合があります。
原因はこれ以外の場合もあると思いますが、初動としてはまずここを疑ってみてください。

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?