---
title: "Discussion on \"Docker + Laravel: Why Your App Can't Reach MySQL (and the One-Line Fix)\" | Hashnode"
description: "Discussion on \"Docker + Laravel: Why Your App Can't Reach MySQL (and the One-Line Fix)\". You dockerised your Laravel app, ran docker compose up, and the app answers with this:\nSQLSTATE[HY000] [2002] Connection refused\n\nEverything worked on your host machine five minutes ago. Nothing about"
url: "https://hashnode.com/posts/docker-laravel-why-your-app-can-t-reach-mysql-and-the-one-line-fix/6b01a97f036efb93095adcfd"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Docker + Laravel: Why Your App Can't Reach MySQL (and the One-Line Fix)](https://rajadevsolutions.hashnode.dev/docker-laravel-why-your-app-can-t-reach-mysql-and-the-one-line-fix?utm_source=hashnode&utm_medium=feed)

You dockerised your Laravel app, ran docker compose up, and the app answers with this: SQLSTATE\[HY000\] \[2002\] Connection refused Everything worked on your host machine five minutes ago. Nothing about

2d ago · 3 min read · rajadevsolutions.hashnode.dev  
Read the article

-   [#laravel](https://hashnode.com/tag/laravel)
-   [#docker](https://hashnode.com/tag/docker)
-   [#mysql](https://hashnode.com/tag/mysql)
-   [#debugging](https://hashnode.com/tag/debugging)

## Written by

[Raja Hunain](https://hashnode.com/@rajadevsolutions)

@rajadevsolutions

  
[View profile](https://hashnode.com/@rajadevsolutions)

Full Stack Developer — PHP, Laravel, MySQL, JavaScript. I write practical coding solutions at rajadevsolutions.online

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
