DBAtlas · Database operations atlas

1049: Unknown database 'name'

MySQL

What does it mean?

The database (schema) you are trying to connect to or use does not exist on the server. The USE statement or the default database name in the connection string points to a non-existent schema.

Why does it happen?

The database was never created, its name is misspelled (case sensitivity can vary by operating system), it was dropped, or the application is connecting to the wrong environment (dev/prod). Schemas not being migrated when moving to a new server is another common cause.

How to fix it

List the existing databases: SHOW DATABASES; Make sure the name is spelled correctly and the case matches (the lower_case_table_names setting matters). If it does not exist, create it: CREATE DATABASE database_name CHARACTER SET utf8mb4; or restore it from backup. Verify the target environment in the application's connection configuration.

Open in DBAtlas →

More from this engine