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

**Code:** `1049` · **Category:** MySQL · **Seen on:** MySQL

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/mysql/1049-unknown-database)
