---
title: "How to resolve the Unable to connect to database error"
canonical: "https://support.appfire.com/space/SUPPORT/89142104/How%20to%20resolve%20the%20Unable%20to%20connect%20to%20database%20error"
format: markdown
---
## <span style="color: #000000">Symptoms</span>

<span style="color: #000000">One or more SQL macros return the following error:</span>

```
Error rendering macro 'sql-query' : Unable to connect to database using jdbc:mysql://<HOSTNAME>:<PORT>/<DBNAME> with user <USER>

```

## <span style="color: #000000">Cause</span>

*<span style="color: #000000">SQL</span>*<span style="color: #000000"> macro is referencing a data source profile that has one or more incorrect connection configurations. </span>

## <span style="color: #000000">Resolution</span>

<span style="color: #000000">Double check the connection information associated with this data source profile such as: </span>*<span style="color: #000000">Hostname</span>*<span style="color: #000000">, </span>*<span style="color: #000000">Port</span>*<span style="color: #000000">, </span>*<span style="color: #000000">Database</span>*<span style="color: #000000">, </span>*<span style="color: #000000">Username</span>*<span style="color: #000000">, and, </span>*<span style="color: #000000">Password</span>*<span style="color: #000000">. </span>