🚀   Portable does more than just ELT. Explore Our AI Orchestration Capabilities 

Troubleshooting Database Not Found

Sergio
CTO

After authenticating to your database server, Portable verifies that the specified database (and schema, for PostgreSQL) exists. If this step fails, you'll see a "Database Not Found" or "Schema Not Found" error in the diagnostic checks.

What This Means

Portable can connect to your database server, but the specific database or schema you specified doesn't exist. This is usually a configuration issue—either a typo in the name or the database/schema hasn't been created yet.

Understanding Database vs Schema

Different databases use different terminology:

Database"Database" Concept"Schema" Concept
PostgreSQLDatabase (separate data directory)Schema (namespace within database)
MySQLDatabase/Schema (interchangeable)N/A
SQL ServerDatabaseSchema (namespace within database)

In PostgreSQL, you connect to a database and then access objects within a schema. The default schema is public.

In MySQL, "database" and "schema" mean the same thing.

Common Causes

1. Typo in Database/Schema Name

The most common cause. Names are often case-sensitive.

Common mistakes:

  • MyDatabase vs mydatabase (case sensitivity)
  • my_database vs my-database (underscore vs hyphen)
  • prod_db vs proddb (missing character)

2. Database Doesn't Exist

The database may not have been created, or you're pointing to the wrong server.

PostgreSQL - List databases:

SELECT datname FROM pg_database WHERE datistemplate = false;

MySQL - List databases:

SHOW DATABASES;

3. Schema Doesn't Exist (PostgreSQL)

For PostgreSQL, the database may exist but the schema doesn't.

List schemas:

SELECT schema_name FROM information_schema.schemata;
-- or
\dn  -- in psql

4. Wrong Environment

You may be connected to the wrong environment (dev vs staging vs prod) where the database doesn't exist.

5. Database Was Deleted or Renamed

The database may have been dropped, renamed, or migrated to a different server.

6. Insufficient Permissions to See Database

In some configurations, users can't see databases they don't have access to.

PostgreSQL:

-- Check if user can connect to the database
SELECT has_database_privilege('myuser', 'mydb', 'CONNECT');

How to Fix

Create the Database

PostgreSQL:

-- Connect as superuser or user with CREATEDB privilege
CREATE DATABASE mydb;

-- Optionally set owner
CREATE DATABASE mydb OWNER myuser;

MySQL:

CREATE DATABASE mydb;
-- or with character set
CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Create the Schema (PostgreSQL)

-- Connect to the database first
\c mydb

-- Create schema
CREATE SCHEMA myschema;

-- Optionally set owner
CREATE SCHEMA myschema AUTHORIZATION myuser;

-- Grant access
GRANT USAGE ON SCHEMA myschema TO myuser;

Use the Default Schema

If you don't need a custom schema, you can use the default:

  • PostgreSQL: Use public (or leave the schema field empty in Portable)
  • MySQL: The database name is the schema

How to Diagnose

Verify database exists

PostgreSQL:

# List all databases
psql -h db.example.com -U myuser -c "SELECT datname FROM pg_database;"

# Try connecting to specific database
psql -h db.example.com -U myuser -d mydb

MySQL:

# List all databases
mysql -h db.example.com -u myuser -p -e "SHOW DATABASES;"

# Try connecting to specific database
mysql -h db.example.com -u myuser -p mydb

Verify schema exists (PostgreSQL)

# Connect to database and list schemas
psql -h db.example.com -U myuser -d mydb -c "SELECT schema_name FROM information_schema.schemata;"

Check exact name and case

-- PostgreSQL: Check exact database name
SELECT datname FROM pg_database WHERE lower(datname) = lower('MyDatabase');

-- PostgreSQL: Check exact schema name
SELECT schema_name FROM information_schema.schemata WHERE lower(schema_name) = lower('MySchema');

-- MySQL: Check exact database name
SELECT schema_name FROM information_schema.schemata WHERE lower(schema_name) = lower('MyDatabase');

Cloud-Specific Instructions

AWS RDS

  1. Databases are created within the RDS instance
  2. Connect to the instance and create the database:
    CREATE DATABASE mydb;
    
  3. The default database created during RDS setup is usually named postgres (PostgreSQL) or the name you specified

Google Cloud SQL

  1. Go to Cloud Console → SQL → Your Instance → Databases
  2. Click Create Database
  3. Or create via SQL:
    CREATE DATABASE mydb;
    

Azure Database

  1. Go to Azure Portal → Your Database Server
  2. Under Settings, select Databases
  3. Click Add to create a new database
  4. Or create via SQL

Heroku Postgres

  1. Heroku creates a default database automatically
  2. Find the database name in your Heroku config vars (DATABASE_URL)
  3. The database name is typically a random string like d1234abcd

PostgreSQL Schema Best Practices

For PostgreSQL, consider your schema strategy:

Option 1: Use the public schema (simplest)

  • Leave the schema field empty or set to public
  • All objects go in the default schema
  • Good for simple setups

Option 2: Custom schema per application

-- Create dedicated schema
CREATE SCHEMA portable_data;
GRANT ALL ON SCHEMA portable_data TO myuser;

-- Set as default for user (optional)
ALTER USER myuser SET search_path TO portable_data, public;

Option 3: Let Portable create the schema

  • Some configurations allow Portable to create the schema if it doesn't exist
  • Check your destination settings for a "Create Schema" option

Checklist

Before contacting support, verify:

  • Database name is spelled correctly (check case sensitivity)
  • Database exists on the server (run SHOW DATABASES or check pg_database)
  • For PostgreSQL: Schema exists (run \dn or check information_schema.schemata)
  • You're connecting to the correct server/environment
  • User has permission to see/access the database
  • If using cloud provider: Check the database list in the cloud console

Still Stuck?

If the database exists but Portable still reports an error, contact support with:

  • Your database type (PostgreSQL, MySQL)
  • The exact database name configured in Portable
  • The exact schema name (for PostgreSQL)
  • The output of the database/schema listing queries
  • Your source/destination ID from Portable