# Connecting to MariaDB Database

[MariaDB ](https://aws.amazon.com/rds/mariadb/)is a database management system used for storing data in a structured format and making it accessible for use through different tools and applications. Astera offers native connectivity for MariaDB databases at both source and destination points.&#x20;

The connectivity also extends to other objects such as Database *Lookup, SQL Query Lookup, SQL script task in a workflow, and Database Write Strategies.*

To learn more about MariaDB and its installation, click [here](https://mariadb.org/).

In this article, we will cover:

1. Connecting to MariaDB in Astera.
2. Data reading options available for MariaDB database.
3. A use case to see how you can work with MariaDB databases in Astera.

### Use Case

To configure the connection with MariaDB databases, we will be using the [*Database Table Source*](https://documentation.astera.com/astera-data-stack-v10/dataflows/sources/database-table-source) object.

1. To configure the *Database Table Source* object, right-click on its header and select *Properties* from the context menu.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FaQxVBfriCn95bhIDLbrF%2F01-MariaDB-Source-Object.png?alt=media\&token=29a64fe3-7786-4eed-b19c-e70bf679d561)

As soon as you have selected the *Properties* option from the context menu, a new window will open.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FcWy1Agh6NRLuczmngnsw%2F02-MariaDB-Connection-Screen.jpg?alt=media\&token=ff0dcafe-40fc-47a1-aed2-914d1c251730)

This is where you will configure the connection with the database.

2. The first step is to specify the *Data Provider* for the source object.

Select *MariaDB* as your data provider from the list.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FDGRRWybxzxjZ6qbygZZW%2F03-MariaDB-Data-Provider.png?alt=media\&token=a5870fcc-ef16-4402-9095-e0c134ab9a7c)

* Put in the required credentials for your MariaDB data provider account.
  1. *User ID*
  2. *Password*
  3. *Server Name*
  4. *Database*
  5. *Schema*
  6. *Port*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FCXrRVpDbKPIb4KoWyVTD%2F04-MariaDB-Credentials.png?alt=media\&token=9a38c336-795d-4765-9aed-5b90bd777847)

* *Test Connection* to check that your database connection is successful and click *Next*.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fhxu5psQUFsFKhs2V8zLP%2F05-MariaDB-Test-Connection.png?alt=media\&token=28513458-a092-4631-bfcc-693baf0ef40e)

Once the connection is established, you can *Pick Source Table* and modify *Reading Options* for MariaDB Database on the *Properties* window.

To read more on different data reading options in a *Database Table Source*, click [here](https://documentation.astera.com/astera-data-stack-v10/dataflows/sources/database-table-source).

You have now successfully configured MariaDB as the database provider for your *Database Table Source* object. The fields from the source object can now be mapped to other objects in a dataflow.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FYMa95kAqLBlGS3wt6ize%2F06-MariaDB-Source-Object.png?alt=media\&token=f3f08d67-2396-4291-864b-a57099b7ac2f)

Let’s use the data from the selected table from the *MariaDB Database* table in a dataflow.

In this example, we have sourced *Customers* data from the database. We need to filter out data of customers with the contact title ‘Sales Representative.’

We will use the *Filter* transformation to filter out records of customers who are Sales Representatives.

To know more about how a *Filter Transformation* works in Astera, click [here](https://documentation.astera.com/astera-data-stack-v10/dataflows/transformations/filter-transformation).

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fb1YEdfKBBlsJC3aBi0a5%2F07-MariaDB-Filter-Transformation.png?alt=media\&token=6d3c942b-4ce4-4751-b418-4ddf24c286c1)

If we preview the output, we have filtered records for *Customers* with the contact title as Sales Representatives.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FtthsxNqvzWoZ4LHvBlq2%2F08-MariaDB-Data-Preview.png?alt=media\&token=a79e39e9-10ad-46e8-a04c-0639cb5d91bd)

Now, we can write this data to a destination in Astera.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FfUYSjz2TCD2ikp7zxelF%2F09-MariaDB-Writing-to-Destination.png?alt=media\&token=0a87ab46-9e21-4ba6-b705-0f7ec45e5e8f)

In this case, we have written the data to an *Excel Workbook Destination*.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F4NdaNrCgpdkzLyo8C4Kl%2F10-MariaDB-UseCase.png?alt=media\&token=71d9d00c-5afd-41fa-a0e0-e0d8803feccd)

We have successfully connected to *MariaDB Database* and completed our use case in Astera.
