# MariaDB

Using the MariaDB storage engine you can use any MariaDB setup as your ngSurvey backend.&#x20;

## Requirements

To install  ngSurvey on a MariaDB database you will need to meet following requirements

1. MariaDB version 10.6.x or above.
2. User used to connect to the MariaDB server must have enough privileges to use the MariaDB system database to create the database.&#x20;
3. If binary logging is enabled you must set the log\_bin\_trust\_function\_creators variable to 1 either in your MySQL configuration file or using following query.\
   `SET GLOBAL log_bin_trust_function_creators = 1;`
4. Windows based MariaDB version requires to have loaded time zone data tables . You may follow this [tutorial](https://www.geeksengine.com/article/populate-time-zone-data-for-mysql.html) to load up time the zone data on your Windows MariaDB server.

## NGSurvey configuration

In order to configure ngSurvey to work with MariaDB you need to setup following environment variables.

{% hint style="info" %}
NGSurvey will automatically create or update the database that you have specified in the connection string.&#x20;
{% endhint %}

* **`ConnectionStrings:NGSurveyDB`** holds your connection string to your MariaDB server.
* **`NGSurvey:StorageEngine`** must be set to *MariaDB.*

## Health check

Once you have configured your database settings you may re-start the web service hosting ngSurvey. NGSurvey will automatically setup the database will all the required tables.

You may also check if your installation is properly setup using following link :\
<https://yourrootsite/api/system/status>

## File uploads

If you're planning to collect files from your respondents using file upload answers make sure that you set a large max\_allowed\_packet size in your MySQL configuration file as this defines the max size of files that will be stored in your MySQL database

```
[mysqld]
max_allowed_packet=512M
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ngsurvey.com/installation-setup/installation/database-backend/mariadb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
