Define a production database
Point UserLock to a new, empty SQLite, SQL Server or MySQL production database from the console database wizard.
UserLock stores session events and administrator actions in its production database. By default, UserLock ships with an SQLite database. You change the production database from the database wizard in the console.
This guide describes how to connect UserLock to a new, empty database. To keep your existing data, see Migrate the UserLock database instead: it follows the same wizard.
Note
For supported systems and prerequisites, see Database architecture.
For the connection fields of each provider, see Server settings ▸ Database.
You no longer need to create the database beforehand. If the database name (SQL Server, MySQL) or the file (SQLite) you enter in the wizard does not exist, UserLock creates it, along with the required tables.
Situation | What UserLock does | Account rights required |
|---|---|---|
The SQL Server or MySQL database does not exist | Creates the database and its tables | Create databases on the server |
The SQL Server or MySQL database already exists | Connects to it without modifying existing data | Read, write and create tables |
The SQLite file does not exist | Creates the file and its tables | Not applicable (no database account) |
The SQLite file already exists | Connects to it without modifying existing data | Not applicable (no database account) |
With Windows authentication, give these rights to the Service impersonation account.
Unlike a migration, which clears the UserLock tables of the target database, Don't migrate data leaves an existing database unchanged.
In the UserLock console, click the ⚙️ wheel (top right), then select Database in the left menu.
Under Production database, click Change production database. The database wizard opens.
On the Select the database provider step, select SQLite, SQL Server, MySQL or Connection string, then click Continue.
Enter the connection details, then click Continue. UserLock tests the connection before moving to the next step. For the fields of each provider, see Server settings ▸ Database.
On the Data migration step, select Don't migrate data, then click Continue. If the database already exists, its data is not modified.
On the Confirm database changes step, review the summary, then click Confirm and apply.
UserLock creates the database if needed, then switches to it immediately.
Note
No change is applied before you click Confirm and apply.
The previous database is not modified or deleted.
For more advanced scenarios, see:
Install and configure SQL Express: for administrators who need to deploy SQL Express.
Migrate the UserLock database: change the production database and keep your existing data.
Migrate between SQL Server instances: switch databases during infrastructure changes.