Appearance
Database and first administrator
The game and web platform use the same database. The clean schema contains table definitions and minimal startup records, including SAPD and FDSA. It does not ship an administrator, character, property or vehicle population.
Fresh database import
The supplied SQL creates and selects omprp. If you choose another name, review both the CREATE DATABASE and USE statements before importing.
sh
mariadb -u root -p < database/schema.sqlsql
source F:/path/to/OpenRP-Framework/database/schema.sql;PowerShell does not use the same input-redirection syntax as a Unix shell. Open the MariaDB client and use source on Windows instead of pasting the Linux redirection example.
Create an application user
Use a database administration account for this step. Replace the password and host with your own values. The following example permits the application account from the local machine only:
sql
CREATE USER 'openrp'@'localhost' IDENTIFIED BY 'REPLACE_WITH_A_RANDOM_PASSWORD';
GRANT SELECT, INSERT, UPDATE, DELETE ON omprp.* TO 'openrp'@'localhost';Grant access for the actual source host/network when the database runs in another service. Schema imports and migrations should be performed by an administrator with DDL rights; the running applications should not need an administrative database login. Use the same database name in mysql.ini and DATABASE_URL.
ini
# mysql.ini — game connection
hostname = 127.0.0.1
username = openrp
password = REPLACE_WITH_A_RANDOM_PASSWORD
database = omprp
auto_reconnect = trueIn a database URL, percent-encode characters in the username or password that have URL meaning, such as @, :, /, # and %. This encoding is for the URL, not the literal password in mysql.ini.
First administrator
Configure the web environment before running these commands inside web-platform/web/:
sh
npm ci
npm run db:generate
npm run admin:create -- --name Admin_User --email owner@example.comReplace the account name and email. The script generates a random password and prints it once. Save it in your password manager. It creates a Developer, level 8, account and refuses to run if any administrator already exists. It creates no character; sign in to the UCP and create one there.
No shared starter password is supplied. The bootstrap email starts unverified; use the UCP verification flow after SMTP is working. Additional staff can be promoted through the existing staff tools.
Existing installations
Back up first, then apply web-platform/web/prisma/sql/framework-web.sql through a MariaDB client. It adds the web tables/columns required by this version without reseeding game content. Regenerate Prisma and restart the web application.
Do not use Prisma as the owner of the game schema
The web Prisma schema models only the portion of the database used by the web app. Do not run prisma db push or reset migrations against the full game database. Use explicit, reviewed SQL changes.
Check your result
Run npm run db:check in the web directory. It checks coverage between the checked-in ORM schema and SQL; it is not a live connectivity or database health test. Then open the UCP and ACP against your actual database. Empty lists are expected on a clean install.