> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Database does not exist or not authorized

> Resolve the error returned when your pipeline can't compile an SQL query because it can't access the database.

## Error message

```text wrap theme={null}
SQL compilation error: Database <database name> does not exist or not authorized
```

This error can appear when using any component.

### Explanation

The database your pipeline is trying to access doesn't exist, or you don't have the required permissions to access it. As a result, your pipeline can't compile the SQL query.

### Potential causes

* The database name is configured incorrectly.
* The database doesn't exist yet.
* Your permissions aren't correct.

***

## Resolve the error

1. Check that the database exists and that the database name is correct in your database system.

   * If the database doesn't exist in your database system, create the database.
   * If the database name is different in your database system, update your pipeline configuration to match.

2. If the database exists and the name is correct, check that your user account has the permissions required to access this database.

3. If your permissions are correct, check the database name, username, and password in your Maia connection settings. If any of these details are incorrect, update them.

4. Re-run the pipeline.

5. If you still need help, [contact Maia Support](https://support.matillion.com/s/) and include the items listed below.

   * The full error text.
   * The root pipeline execution ID.
   * The Maia runner ID and time of failure (UTC).

### Prevent future errors

To prevent this error occurring again, do the following before you run pipelines that use a new database:

* Check that the database exists.
* Check that the database name matches your pipeline configuration.
* Check that your user account has the permissions required to access the database.


## Related topics

- [SQL compilation error in the warehouse](https://docs.maia.ai/docs/errors/sql-compilation-error-in-the-warehouse.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.