---
title: How to Fix the Unknown Database Error When Connecting to MySQL?
url: https://docs.vultr.com/support/products/storage/databases/mysql/how-to-fix-the-unknown-database-error-when-connecting-to-mysql
description: Fix MySQL ERROR 1049 on Vultr by confirming the cluster and database name, then running SHOW DATABASES.
publish_date: 2025-09-15T13:59:04.789397Z
last_updated: 2026-10-26T23:33:00.146379Z
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

The error `ERROR 1049 (42000): Unknown database 'default'` occurs when MySQL cannot locate the database specified in your connection command. This typically happens if:

* You are connecting to the wrong Vultr Managed Database cluster.
* The database name in your connection string does not match any database that exists in the selected cluster.

To resolve the `Unknown database` error:

* Use the correct `hostname` and `port` from the [Connection Details](https://docs.vultr.com/products/storage/databases/mysql/management/connection/connection-details) section on your database's Overview page.
* Verify the database exists:
  
    1. Connect to the MySQL client without specifying a database:

        ```console
        $ mysql --host="<hostname>" --port=<port> --user="<username>" -p
        ```

    1. List all available databases:

        ```sql
        mysql> SHOW DATABASES;
        ```

    1. If your target database is missing, create it:

        ```sql
        mysql> CREATE DATABASE <database_name>;
        ```

    >[!NOTE]
    >MySQL database names are case-sensitive on Unix-based systems, including Vultr’s default Linux environments. Ensure the name matches exactly.
