Platform-specific

    Error establishing a database connection on Cloudflare

    Why it happens on Cloudflare

    Cloudflare caches the error page itself, so visitors keep seeing the database error for minutes after the database is back.

    The fix on Cloudflare

    Purge everything in Cloudflare → Caching after the fix, and set a Cache Rule that bypasses cache for 5xx responses so a future outage does not stick.

    Is Error establishing a database connection happening on your domain?

    An external probe records whether the failure is constant or intermittent, and captures the exact minutes it occurs — which is what distinguishes wrong credentials from connection exhaustion.

    Free, no signup. Runs from outside your network, which is the only way to tell a server fault from a local one.

    If that didn't fix it

    Cloudflare has its own failure mode, but Error establishing a database connection has a wider set of causes that apply everywhere. The most common one overall is: the database server is down or out of memory.

    All causes and fixes for Error establishing a database connection

    Error establishing a database connection on other platforms and devices

    Monitor this continuously with LemWatch

    A one-off error establishing a database connection monitoring shows you today. LemWatch re-runs the same checks around the clock and alerts you the moment something breaks — free for up to 10 sites, no card needed.

    Last verified: by the Lemwatch research team.