1049 MySQL Origin: Data Last updated 13 Oct 2026

MySQL ERROR 1049 (42000): Unknown database 'x'

The database named in the connection doesn’t exist on that server.

Exact message you may see Unknown databaseSQLSTATE[HY000] [1049]
Seen on: MySQL

Meaning

Typos, case sensitivity on Linux, connecting to the wrong server/environment, or the database was never created.

Common causes

  • Database not created
  • Typo/case mismatch in DB_DATABASE
  • Connected to a different server (local vs production)
  • Shared hosting prefix missing (user_dbname)

⚡ Quick fix

  1. CREATE DATABASE or create it in the hosting panel
  2. Fix the name (include the cPanel prefix)
  3. Verify host/port point to the right server

Detailed fix by platform

MySQL

  1. SHOW DATABASES;

How to diagnose

  1. Name — Exact name?
  2. Server — Right host?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

1000 — Cloudflare Error 1000: DNS points to prohibited IP (Cloudflare)10001040 — MySQL ERROR 1040 (08004): Too many connections (MySQL)10401045 — MySQL ERROR 1045 (28000): Access denied for user (MySQL)10451046 — MySQL ERROR 1046 (3D000): No database selected (MySQL)10461153 — MySQL ERROR 1153 (08S01): Got a packet bigger than 'max_allowed_packet' bytes (MySQL)11532002 — MySQL ERROR 2002 (HY000): Can't connect to local MySQL server through socket (MySQL)20022003 — MySQL ERROR 2003 (HY000): Can't connect to MySQL server on 'host:3306' (111) (MySQL)20032006 — MySQL ERROR 2006 (HY000): MySQL server has gone away (MySQL)20061049

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.