---
locale: "en"
updated_at: "2025-10-27T13:54:35.652Z"
canonical: "https://www.isdecisions.com/en/userlock/docs/reference/server-settings/database"
---

# Database

Change production database, read-only access, data cleaning.

> **Note**
>
> - To access this page, go to **Server settings ▸ Database**.
> - You need at least *read* [permission](/userlock/docs/reference/server-settings/permissions) on Server settings to view this page.

## Information

This section displays some statistics about your database:

- The number of records
- The date and time of the first recorded event
- The date and time of the last recorded event
- The number of days the database has been in use

## Database connection

![](https://a.storyblok.com/f/122374/1227x827/a57a61cc38/server-settings-database-connection.png)

The installation package for UserLock includes a free **Microsoft Access database** file (named **UserLock.mdb**) to simplify evaluation and initial setup. This database is configured as the default storage for all audited events, but it is limited to **2 GB** (structural limitation).

For production, we recommend using one of the following to ensure better retention and performance:

- **Microsoft SQL Express** (maximum size 10 GB)
- **SQL Server** (no theoretical size limit)
- **MySQL** (driver installation required)

> **Note**
>
> For step-by-step instructions on how to configure UserLock with a production database, see the [Production database setup guide](/userlock/docs/guides/database/define-a-production-database).

In this section, select the appropriate options according to the database system you choose:

| Option | Description |
| --- | --- |
| **Database type** | - SQL Server - MS Access *(default)* - MySQL *(requires driver)* - Connection string *(for other unsupported database types)* |
| **Server** | Enter the server name hosting the database. |
| **Authentication** | - Windows - SQL (*username and password required*) |
| **Database** | Once the previous parameters are filled in, the list of available databases is loaded. Select the UserLock database you created. |

### 

> **Note**
>
> - Before saving, click **Test connection** to validate the settings (a toast message will confirm the result in the bottom-right corner).
> - ⚠️ Tables are automatically created when the first events are recorded in the database (e.g., a lock/unlock event on a machine with the Desktop Agent installed).
> - The **Restore default database** button resets the configuration to use the default MS Access database.

## Read-only access

![](https://a.storyblok.com/f/122374/1211x413/2760adced9/server-settings-database-read-only.png)

A second connection string with fewer privileges can be defined for **read-only access**.
This connection is used when no modification rights are required (e.g., generating reports), which limits write access to only those operations that need it.

- Enable the option
- Select the authentication mode (Windows or SQL)
- Test the connection before saving

## Use Greenwich Mean Time

![](https://a.storyblok.com/f/122374/1215x120/c06e8e7a85/server-settings-database-options.png)

### 

This option saves all audited events with **GMT time** instead of local time.

> **Note**
>
> ⚠️ This option is not retroactive: events already stored will keep their original timestamps. Only new events will follow the newly selected mode.

## Database cleaning

![](https://a.storyblok.com/f/122374/1228x243/31f1700947/server-settings-database-cleaning.png)

By default, UserLock keeps all events indefinitely in its database.
You can configure automatic cleaning to delete old logon events and prevent excessive database growth.

- Enable the option
- Specify the number of days to keep events
- Every day just after midnight, older logon events are deleted

> **Note**
>
> ⚠️ Cleaning operations are permanent and cannot be undone.

## Best practices and warnings

- Always switch to **SQL Express / SQL Server / MySQL** for production. MS Access is only recommended for evaluation.
- If you use a MySQL database or if you use the SQL Server authentication configure the **read-only access** to reduce risks of unwanted modifications.
- Be careful with **Database cleaning**: deletion is permanent and irreversible. Always check your retention requirements before enabling it.
- Regularly **monitor database size and performance**, especially if you store large session histories.

> **See also**
>
> 💡 For background information on how UserLock uses its database, supported systems, and the internal schema, see [Database architecture](/userlock/docs/reference/core-concepts/database-architecture).
