# Oracle MySQL

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

## Requirements

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

1. MySQL version 8 or above.
2. User used to connect to the MySQL server must have enough privileges to use the MySQL 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 MySQL version requires to have loaded time zone data tables . You may follow this [tutorial](https://www.raymondcamden.com/2012/02/27/How-to-add-MySQL-time-zone-tables-on-Windows) to load up time the zone data on your Windows MySQL server.

{% hint style="danger" %}
ngSurvey requires that the MySQL server is configured with working system time zone tables. If your MySQL installation is not setup with time zone you can add them manually <https://dev.mysql.com/doc/refman/8.4/en/mysql-tzinfo-to-sql.html>
{% endhint %}

## NGSurvey configuration

In order to configure ngSurvey to work with MySQL 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 MySQL server.
* **`NGSurvey:StorageEngine`** must be set to *MySQL*.

<img src="https://1025048312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8fLhS0bmfBRyq0HdUm%2Fuploads%2FyEOJYoy7l1QMY6qZuup8%2Fimage.png?alt=media&#x26;token=71aefb1b-ae1a-4e20-b8d4-6fb44560f139" alt="" data-size="original">

## 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 ini configuration file as this defines the max size of files that will be stored in your MySQL database

```
[mysqld]
max_allowed_packet=512M

```
