21. Miraj Server Manager
Miraj Server Manager (miraj-manager.exe) is the graphical administration tool for a MIRAJ server installed on a Windows workstation or server. It lives in the Windows notification area and brings together the everyday operations:
- start, stop, and restart the server;
- monitor its state and the resources it consumes (processor, memory, disk);
- monitor queries: total count, queries per second, running queries, slow queries;
- make a full backup of all databases to a chosen folder, immediately or on a schedule (time, days, number of backups kept);
It administers the server of the machine it runs on: it acts on the miraj-server.exe process and on Windows scheduled tasks, which cannot be done remotely.
21.1 Installation and launch#
The Miraj Express installer places miraj-manager.exe in the program folder, next to miraj-server.exe (see 2.2). It adds a Start menu shortcut and offers two options, checked by default: starting the manager with Windows (at administrators' sign-in, icon only) and launching it at the end of the installation.
Without the installer, simply copy miraj-manager.exe into the folder of miraj-server.exe (see 21.2).
21.1.1 Command line#
| Command | Effect |
|---|---|
miraj-manager | Notification area icon and open window. |
miraj-manager --tray | Icon only, window hidden: this is how it is launched at sign-in. |
miraj-manager --scheduled-backup | Scheduled backup, with no window: launched by the Windows task of the schedule (see 21.10), never by hand. |
miraj-manager --no-elevation | Does not ask for administrator rights (see below). |
21.1.2 Administrator rights#
The manager asks for administrator rights at launch (User Account Control prompt). They are required to:
- start and stop the installed server, which runs under the SYSTEM account;
- create or delete scheduled tasks (backups, launch at sign-in);
- read the memory and I/O of a process belonging to another account;
- protect the backup account's secret (see 21.10).
If elevation is refused, the manager still opens and displays at the top of the window: "Without administrator rights: starting and stopping the installed server, scheduling, and memory measurements may fail". Consultation (state, queries) and immediate backup remain possible.
21.1.3 A single instance#
Only one manager runs per Windows session. Launching it again (shortcut, double-click on the executable) shows the window of the one already running, then exits.
21.2 The managed server#
The manager finds the server to administer on its own, in this order:
- the executable and data folder recorded in its settings (
manager.json, see 21.11), if they are filled in; - those of the "Miraj Express" scheduled task created by the installer: the task's command and the value of its
--rootargument; - failing that, the
miraj-server.exeplaced next tomiraj-manager.exe, with the installation's default data folder,%ProgramData%\Miraj Express\data.
It then reads the server's configuration file, in the same place as the server itself (see 11.2): miraj_config.xml next to miraj-server.exe if it exists there, otherwise in the data folder. It retains the following from it:
| Variable | Use in the manager | Default |
|---|---|---|
port | Listening port monitored and connection port. | 7007 |
bind | Connection address; 0.0.0.0 (all interfaces) yields the loopback 127.0.0.1. | 0.0.0.0 |
language | Language of the manager's texts (see 21.4). | en |
backup_dir | Working folder for backups (see 21.10.1). | none |
The file is re-read every two seconds: a change is picked up without restarting the manager (the server, for its part, only reads it when it restarts).
The server process is recognized by the full path of its executable. Another running miraj-server.exe, launched from a different folder, is never stopped or measured: it is only flagged in the State tab ("Another MIRAJ server is running: …").
21.3 Notification area#
The Miraj Server Manager icon stays in the notification area as long as the manager is running. Its tooltip gives the server's state ("Miraj Server Manager — Running").
- Click on the icon: opens the window.
- Right-click: menu.
| Menu entry | Effect |
|---|---|
| Miraj Server Manager — state | Reminder of the state (grayed-out entry). |
| Open | Opens the window. |
| Start | Starts the server (grayed out if it is already running). |
| Stop | Opens the window and asks for confirmation, then stops the server. |
| Restart | Opens the window and asks for confirmation, then restarts the server. |
| Launch the manager in the notification area at sign-in | Checkbox: creates or deletes the "Miraj Express - manager" scheduled task, which launches miraj-manager.exe --tray at sign-in, with administrator rights and no prompt. |
| Quit | Closes the manager. Refused while an action (start, backup, etc.) is in progress. |
Start, Stop, and Restart are grayed out while an action is in progress.
Closing the window (the cross) does not quit: the window is tucked into the notification area, and a balloon says so the first time. Only Quit stops the manager.
Unexpected stop. If the server stops without the stop coming from the manager (stopped by another tool, crash), a notification balloon announces it: "The MIRAJ server has stopped."
Launch at sign-in. The installer creates the same "Miraj Express - manager" task for all members of the Administrators group. The menu checkbox reflects it: unchecking it deletes it for everyone; checking it again recreates it for the current Windows account only.
21.4 Language#
The manager's texts follow the server's language: the language variable of miraj_config.xml, English by default. The ten languages of the server's error messages are available: English, French, Chinese, Hindi, Spanish, Arabic (right-to-left layout), Portuguese, Russian, German, Japanese. A change to language applies to the manager within two seconds, menus and balloons included, without waiting for the server to restart.
21.5 The window#
At the top of the window:
- the name Miraj Server Manager and the server's status badge, with its uptime;
- three large buttons: Start (green), Stop (red), Restart (blue). A button that does not apply is dimmed: Start when the server is running, Stop and Restart when it is stopped, all three during an action in progress;
- on the right, the connection to the server (see 21.6);
- below, the progress of the current action: title and wait indicator, then each step and the final result, preceded by ✔ (success) or ✖ (failure, with the cause);
- finally the four tabs State, Resources, Queries, and Backups.
Each tab begins with a row of tiles (the main figures, in large type) followed by cards. A path or text that is too long is truncated; hovering shows it in full.
| Badge | Meaning |
|---|---|
| ● Running | The server process is running and listening on its port. |
| ◐ Starting, or port closed | The process is running but is not (yet) listening on the port. |
| ⚠ Port in use by another program | The server is stopped, but another program is listening on its port: the server could not start. |
| ■ Stopped | No server process. |
The manager never connects to the port to test it: it reads the list of listening ports maintained by Windows. The server log (server.log) is therefore not cluttered by its monitoring.
21.5.1 Start, stop, restart#
Start. If the installation's "Miraj Express" scheduled task exists, the manager launches it: the server then runs under the SYSTEM account, as at Windows startup. Otherwise, it directly launches miraj-server.exe --root <data folder> --log. It then waits for the server to listen on its port, 30 seconds at most. Starting is refused up front if the server is already running or if the port is taken by another program; it fails if the process stops as soon as it is launched (the message then points to server.log).
Stop. After confirmation ("Open connections will be cut and their transactions in progress rolled back"), the manager stops the "Miraj Express" task if it exists, ends the server process, then waits for the process to be gone and the port to be released, 15 seconds at most. Like any stop of miraj-server, this is a stop with no shutdown sequence: no committed transaction is lost, as the write-ahead log is replayed at the next startup (see 11.1.2 and 11.4).
Restart. Stop then start, after the same confirmation.
21.6 Connecting to the server#
The process state and resources are measured without a connection. SQL information (version, connections, databases, queries) and backups require a connection to the server: enter the account and password at the top right, then Connect (or Enter). Once connected, the manager displays "● Connected: root" and a Disconnect button.
- The account entered is remembered from one launch to the next; the password is never saved: it is asked for again each time the manager is launched.
- A rejected password is not retried: the server blocks an address after a series of authentication failures (see 11.5.2). The server's message is displayed under the buttons; correct the password and reconnect.
- After a server restart, the connection is re-established automatically.
Use an administrator account, root for example. An account with reduced rights sees what its privileges allow: SHOW FULL PROCESSLIST only shows its own connections without the PROCESS (or SUPER) privilege, backup requires BACKUP_ADMIN, configuring the slow query log requires SUPER or SYSTEM_VARIABLES_ADMIN, and scheduling backups requires being able to create an account and grant it BACKUP_ADMIN (see 21.10).
Every two seconds, when connected, the manager reads SHOW GLOBAL STATUS, a few variables (slow_query_log, long_query_time, log_output), SHOW DATABASES, the last 200 rows of mysql.slow_log, and SHOW FULL PROCESSLIST.
21.7 State tab#
Tiles: uptime, open connections, number of databases, size of the data folder (with the free space of the disk that holds it). SQL figures display "—" without a connection.
Server card:
| Row | Content |
|---|---|
| Process | miraj-server.exe, PID …, or "none". |
| Started on | Date and time the process started. |
| Listening | Address and port from miraj_config.xml, followed by "(responding)" or "(closed)". |
| Version | Server version (when connected). |
| Open connections | Threads_connected, and the maximum since startup (Max_used_connections). |
| Databases | List of databases visible to the connected account. |
| Automatic start | "yes, scheduled task "Miraj Express" (SYSTEM account)", or "no" if the server is launched directly by the manager. |
| Executable, Data folder | Paths of the managed server (see 21.2). |
The Edit miraj_config.xml… button opens the server's configuration file in the configuration editor (miraj-config-editor.exe, present next to the server in an installation by the installer). Changes take effect when the server restarts.
Server log card: the last 60 lines of <data>\miraj\server.log, the most recent at the top, with a Refresh button. This file only receives errors (see 11.6.3): when empty, it indicates that no error has been reported.
21.8 Resources tab#
The measurements cover only the server process, sampled every two seconds. With the server stopped, the tab displays "Server stopped: no measurements".
Tiles:
| Tile | Measurement |
|---|---|
| Processor | Share of the machine's processor, all cores combined: 100% means all cores are busy with the server. The number of cores is shown below. |
| Memory used | Physical memory occupied by the process (working set), and its share of the machine's memory. |
| Disk reads, Disk writes | The process's read and write throughput, per second, as Windows counts them: network exchanges with clients are included along with file accesses. |
Charts: processor and memory over the last ten minutes, one point every two seconds. On hover, a vertical line gives the value of the point and its age ("12 s ago"). The history starts when the manager is launched.
Details card: cumulative processor time since startup, private memory (memory specific to the process, which it shares with no other), peak memory, free memory of the machine, reads and writes (throughput and total since startup), threads, handles, and, when connected, parallel threads busy out of the total parallelism budget (Miraj_parallel_workers_busy / Miraj_parallel_workers).
21.9 Queries tab#
The tab requires a connection (see 21.6).
Tiles:
| Tile | Source |
|---|---|
| Total queries | Questions: statements executed since the server started, all sessions combined (see 11.6.1). Below, the corresponding duration (Uptime). Large numbers are abbreviated (12.9 k, 4.2 M). |
| Queries per second | Throughput measured over the last two seconds; below, the average since startup. The manager's own reads are removed from the count. |
| Slow queries | Slow_queries: statements longer than the long_query_time threshold, shown below. |
| Running | Statements currently executing. |
Chart: queries per second over the last ten minutes.
Slow query log card. Enabled checkbox, Threshold (seconds), and Apply button: the manager executes SET GLOBAL long_query_time = … and SET GLOBAL slow_query_log = ON|OFF. These settings are lost when the server restarts, unless the Keep after restart (miraj_config.xml) box is checked (the default): the variables slow_query_log and long_query_time are then also written to miraj_config.xml, without touching the rest of the file (comments included). With the log disabled, only the Slow_queries counter advances.
The slow query table reads the mysql.slow_log table. When the log is active, the manager therefore adds the TABLE output to the file output (SET GLOBAL log_output = 'FILE,TABLE'): the slow.log file continues to be written.
Running queries card (SHOW FULL PROCESSLIST, without idle connections): identifier, account, database, duration, state, and query text. A duration of at least 10 seconds is marked ⚠. The text is shortened to one line; hovering shows it in full and a click copies it to the clipboard.
Recorded slow queries card: the last 200 rows of mysql.slow_log (start, duration, rows read, rows returned, account, database, query), sorted Most recent or Longest, with a Filter on the query text. Clear executes TRUNCATE TABLE mysql.slow_log. The durations in the table are accurate to the second.
21.10 Backups tab#
The manager makes full backups: all databases, with BACKUP ALL DATABASES (see 18.1). The server stays in service during the backup.
21.10.1 Server working folder (backup_dir)#
The server only writes a backup into its backup folder, the backup_dir variable (see 18.1.1). The Server backup working folder card displays it. If it is not defined, the card says so and suggests a backups folder next to the data folder (never inside it). Set and restart, after confirmation, creates the folder, writes it into miraj_config.xml, and restarts the server, which only reads this setting at startup.
21.10.2 Immediate backup#
Full backup card: choose the Backup destination (typed in or Browse…; Open shows it in the file explorer), then Full backup now. The button requires a connection and a defined backup_dir. The destination is remembered from one launch to the next; by default, it is the folder suggested for backup_dir.
Sequence, displayed step by step:
BACKUP ALL DATABASESinto<backup_dir>\miraj-YYYY-MM-DD_HHMMSS(local date and time);- verification of each backed-up database: presence, size, and checksum of each file ("3 database(s) backed up and verified, 1.2 GiB");
- moving the folder into the destination, if it is somewhere other than
backup_dir(by a simple rename on the same disk, by a copy to another disk); - a line added to the backup log.
The destination must not be inside the data folder. Each database has its subfolder in the backup:
D:\Sauvegardes\miraj-2026-09-25_020000\
gestion\ manifest.json, fichiers .mrj, journal…
compta\An immediate backup never deletes old backups.
21.10.3 Scheduled backup#
Scheduled backup card: check Automatic full backup, choose the time, the days (all by default), and the number of backups kept (7 by default; 0 keeps them all), then Save schedule. As long as it is not saved, a change is flagged "modified, not saved". Saving requires a connection with an administrator account, for the following reasons:
- the manager creates (or updates) the
miraj_backup@localhostaccount, which only has theBACKUP_ADMINprivilege: it can back up, but neither read nor modify data. Its password, 32 randomly generated characters, is renewed on each save; - this password is encrypted for the machine (Windows DPAPI) in
%ProgramData%\Miraj Express\manager\backup.key, a file accessible only to SYSTEM and to administrators; - the "Miraj Express - backup" scheduled task is created: it launches
miraj-manager.exe --scheduled-backupunder the SYSTEM account on the chosen days and time. If the machine was off at the scheduled time, the backup is made as soon as possible after it starts; it is abandoned after 12 hours.
At the appointed time, the manager connects with miraj_backup, makes the backup as in 21.10.2, then deletes the oldest backups in the destination beyond the number to keep. Only folders named miraj-YYYY-MM-DD_HHMMSS are counted and deleted: other files in the destination are never touched. The scheduled backup needs neither the window nor an open session.
Below the card, the line "Next: … Last: … Result: …" shows the task's state as Windows gives it (result 0: success). Unchecking the box then saving deletes the task; the miraj_backup account remains in place (DROP USER to remove it).
Continuous incremental backup (Enterprise and Cluster editions; the checkbox does not exist in the Express manager, and it is grayed out if the connected server is an Express edition). Under the schedule, the Continuous incremental backup (log archived in real time) checkbox makes the server archive every change between two full backups (see 18.1.5). When checked:
- the full backup becomes daily: all seven days are checked and grayed out;
- the Archive folder field appears (by default
archive, next to the data folder; never inside it); - Save schedule writes
journal_archiveandjournal_archive_dirintomiraj_config.xml(they apply at every startup) and applies them immediately withSET GLOBAL. If the server cannot be reached, the setting takes effect at the next startup.
Unchecking the box (or the whole schedule) then saving stops archiving: the server stops archiving and journal_archive goes to false in the configuration. The archive already written is kept. Re-enabling starts a new lineage, and the server immediately takes a new base.
When archiving is active, a status line is added under the card: "Log archive: ON lag … last pass … databases pending …". It turns red (ERROR) if the server can no longer write the archive, for example if the disk is full or unplugged; the cause is in the server log. After each scheduled backup, the manager purges the archive of whatever no longer extends any kept backup. Deletions appear in the backup log.
21.10.4 List and log#
The Backups in the destination card lists the backups present, from the most recent to the oldest, with their size. The Backup log card shows the latest lines of backup.log: successful manual backups, successful scheduled backups with their steps, and scheduled backup failures with their cause.
21.10.5 Restoring a backup#
Restoration is done in SQL, database by database, with RESTORE DATABASE (see 18.1.4). The server only reads a backup from its backup_dir: if the destination is elsewhere, first copy the backup folder into backup_dir, then name the database's subfolder:
-- D:\Sauvegardes\miraj-2026-09-25_020000 recopié dans backup_dir
RESTORE DATABASE gestion_hier FROM 'miraj-2026-09-25_020000\gestion';With continuous incremental backup, add WITH ARCHIVE to replay the archive up to the last change, or up to a given point in time:
RESTORE DATABASE gestion_1530 FROM 'miraj-2026-09-25_020000\gestion'
WITH ARCHIVE UNTIL TIME '2026-09-25 15:30:00';Choosing backup_dir itself as the destination avoids this copy, at the cost of keeping backups on the same disk as the server's working folder. A physical backup does not contain accounts: also keep a miraj-dump --users export from time to time (see 18.4).
21.11 Files and scheduled tasks#
The manager's files are in %ProgramData%\Miraj Express\manager:
| File | Content |
|---|---|
manager.json | Settings: server executable (server_exe), data folder (data_dir), connection account (user), backup destination (backup_target), schedule (schedule: enabled, hour, minute, days from Monday to Sunday, keep). |
backup.key | Password of the miraj_backup account, encrypted for the machine. |
backup.log | Backup log, one timestamped line per event. |
manager.json is written at connection (account) and at each change of destination or schedule. To administer a server other than the one found automatically (see 21.2), fill in server_exe and data_dir there, with the manager closed; left empty, they are searched for again at each launch.
Windows scheduled tasks used:
| Task | Created by | Launches |
|---|---|---|
| Miraj Express | The installer | miraj-server.exe --root <data> --log at Windows startup, SYSTEM account. The manager starts and stops it. |
| Miraj Express - backup | The manager (schedule) | miraj-manager.exe --scheduled-backup, SYSTEM account. |
| Miraj Express - manager | The installer or the icon menu | miraj-manager.exe --tray at sign-in, administrator rights. |
Uninstalling removes these tasks; the manager's folder and its files remain.
21.12 Common messages#
| Message | Cause and remedy |
|---|---|
| the server is already started | Start while the process is running. |
| port N is already in use by another program | Another program (often another MIRAJ or SQL server) is listening on the port of miraj_config.xml. Stop it or change port. |
| the server stopped at startup; see … | The server refused to start: the cause is in the indicated server.log file (invalid configuration, misplaced backup_dir, etc.). |
| the server is not responding on port N after 30 s | Abnormally long startup or blocked server: see server.log. |
| process N does not stop | Stop impossible, often for lack of administrator rights (see 21.1.2). |
| … not found | The server executable does not exist at the retained path (see 21.2). |
| Connection: … | Connection refused (password, locked account, blocked address): the server's message follows. |
| the server has no backup folder (backup_dir) | Define it (see 21.10.1). |
| the destination folder must not be inside the data folder | Choose a destination outside the data folder. |
| database …: … | A backed-up database failed verification: the backup is left in backup_dir for examination and is not moved. |
| connect to the server (administrator account) to create the backup account | Saving a schedule requires a connection (see 21.10.3). |
| no day chosen | Check at least one day. |
Scheduled backup failed: … (backup.log) | Server stopped at the scheduled time, miraj_backup account deleted or modified, backup_dir removed, etc. Saving the schedule again recreates the account and its secret. |
21.13 macOS version#
The package MIRAJ-<version>-Express-macos-<arch>.pkg installs the server and miraj-cli in /usr/local/miraj-express/bin, and places the Miraj Manager application (this chapter) in /Applications. The server's data is in ~/Library/Application Support/Miraj Express and the manager's files in its manager subfolder. The package also installs the ODBC driver /usr/local/miraj-express/lib/libmiraj_odbc.dylib and registers it in /Library/ODBC/odbcinst.ini (installation and uninstallation: chapter 26).
| Feature | macOS |
|---|---|
| Start, stop, restart the server; state; resources; queries | Available. The server is launched with the user's rights (no SYSTEM account); at first startup (empty data folder), a configuration page replaces the window, like the Windows installer: root password (with confirmation), port, and listening on all interfaces or the loopback only. A password left empty is randomly generated and shown only once, with a Copy button, until it is noted down. |
| Immediate backup and restore | Available. |
| Scheduled backup, automatic start of the server and the manager | Absent: no scheduled tasks; the backup account's secret is not encrypted for the machine. |
Notification area icon, single instance, --tray, --scheduled-backup | Absent: the manager is just a window, closing the window quits it. |
| Request for administrator rights at launch | Absent: the manager opens with the user's rights. |