Database Setup

Ticket Nexus stores settings, tickets, the blacklist, and transcripts in a database. Pick SQLite or MySQL with DB_TYPE.

SQLite (default)

env
DB_TYPE=sqlite

No server needed. Data lives in tickets.db in the project root (plus WAL side files). Back that file up before updates and keep it out of version control — it is already gitignored.

MySQL

env
DB_TYPE=mysql
DB_HOST=127.0.0.1
DB_USER=ticketnexus
DB_PASSWORD=your-password
DB_NAME=ticketnexus
DB_PORT=3306

Create an empty database and user first; tables are created automatically on startup.

WARNING

If the MySQL connection fails at startup, the bot logs the error and falls back to SQLite. Check the console for "Failed to connect to MySQL" — otherwise you may be running against a fresh local database without realizing it.

Schema upgrades

Missing columns are added automatically when the bot starts, so updating the code doesn't require manual migrations.