> For the complete documentation index, see [llms.txt](https://docs.aqua-cloud.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aqua-cloud.io/documentation/automation/desktop-client/database.md).

# Database

Automate database operations in the Desktop Client. Learn setup, supported actions, and best practices for seamless integration with your workflows.

In order to connect a database agent to aqua, you have to go through the following steps. First, extract the database agent zip file and open the <mark style="color:orange;">**aquaAgentDatabaseGui.exe.config**</mark>.&#x20;

Here, enter the agentCode and the aquaServiceURL.&#x20;

{% code overflow="wrap" %}

```csharp
  <add key="agentCode" value="yd7zhzc5bd2fiydkyu9j"/> 
  <add key="aquaServiceUrl" value="http://youraquaserver/aquaAPI/aquaagentwebservice.asmx"/> 
```

{% endcode %}

The rest of the config file is not necessary to connect the agent to aqua. The agent code is generated in aqua, and assigned to the agent.&#x20;

Next, click onto Connections in the Agent Server Configuration in order to define the database. &#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_database_rich_client_custom.png" alt=""><figcaption></figcaption></figure>

To create new connections and to add these databases, click on the ![](http://aquawiki.andagon.com/pictures/drex_database_rich_client_custom_2.png) button and insert a new database. &#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_database_rich_client_custom_3.png" alt=""><figcaption></figcaption></figure>

Within the test case, you can insert a database test script. The connection has to be defined in the drop-down box, the query has to be inserted, and there is an option to enter a check value. In order to use variables, place them between '&', e.g.: A variable called '*User*' can be used in the query or in the expected results as '*\&User&*'.

<figure><img src="http://aquawiki.andagon.com/pictures/drex_database_rich_client_custom_4.png" alt=""><figcaption></figcaption></figure>

## **MySQL example** <a href="#mysql_example" id="mysql_example"></a>

1. Download and install (full install) MySQL Connector for .Net on computer running DBAgent (<https://dev.mysql.com/downloads/connector/net/> )
2. Restart DBAgent (if already running)
3. Open aqua -> Project Configuration -> Testautomation -> Connections
4. Create new connection (Choose "Generic")
5. DataSupplier = MySql.Data.MySqlClient
6. Adjust connection string to match MySQL Setup (server, user id, password, database)&#x20;

<figure><img src="http://aquawiki.andagon.com/pictures/drex_mysql_example_custom.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aqua-cloud.io/documentation/automation/desktop-client/database.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
