Vultr DocsLatest Content

Associated Doc

How to Fix the "Unknown Database" Error When Connecting to MySQL?

Updated on 15 September, 2025

A troubleshooting guide explaining how to resolve MySQL connection errors when a specified database cannot be found on Vultr Managed Database clusters.


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 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
      
    2. List all available databases:

      sql
      mysql> SHOW DATABASES;
      
    3. 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.