Running FFTacticsMUD on Linux with MySQL

Setup notes by Liko — Mudhaven — 2026.10.23

I put these steps together for a fresh installation of my Linux repair package.
Use a separate database for this game. You do not need an old SQL backup:
database/schema.sql creates the tables from scratch.

1. Install the build tools

For Ubuntu 24.04 with an existing MySQL server:

sudo apt-get update
sudo apt-get install g++ make libmysqlclient-dev libssl-dev mysql-client unzip tmux nano

These packages provide build and client tools, not a replacement database
server. If this is a new Ubuntu server with no database service, also run:

sudo apt-get install mysql-server
sudo systemctl enable --now mysql

Use your existing MySQL service if you already have one. On Debian or another
distribution, package names may differ; libmariadb-dev is an alternative client
development package. The build accepts mysql_config or mariadb_config.

On a managed host without sudo, ask your host to provide the compiler,
development libraries, and a new empty database with login details.

2. Extract the download

Upload FFTacticsMUD-linux.zip to your Linux account with SFTP or SCP, then
extract it in a new directory, separate from any running MUD:

mkdir fftactics-install
cd fftactics-install
unzip ../FFTacticsMUD-linux.zip
cd FFTacticsMUD-linux

All commands below assume you are in this FFTacticsMUD-linux directory.

3. Create the database and runtime user

Open MySQL as the database administrator using your installation's login method:

sudo mysql

Or, if the administrator uses password authentication:

mysql -u root -p

Run these SQL statements, replacing YOUR_UNIQUE_DB_PASSWORD with a strong
password of your own:

CREATE DATABASE fftactics_trial CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fftactics_trial'@'localhost' IDENTIFIED BY 'YOUR_UNIQUE_DB_PASSWORD';
GRANT SELECT, INSERT, UPDATE, DELETE ON fftactics_trial.* TO 'fftactics_trial'@'localhost';
SHOW GRANTS FOR 'fftactics_trial'@'localhost';
EXIT;

These commands intentionally fail if the database or account already exists.
Check what is there before reusing it. The game account only needs permission
to read and change rows in its own database. Import the schema as the database
administrator. FLUSH PRIVILEGES is not needed after CREATE USER and GRANT.

If your host supplies a database and username, substitute those names throughout
this guide. Hosting providers sometimes add an account prefix to both names.

4. Import the tables

Using the administrator login method from the previous step:

sudo mysql fftactics_trial < database/schema.sql

Or:

mysql -u root -p fftactics_trial < database/schema.sql

Import only into a new, empty database. This file does not drop old tables or
silently skip existing ones. Do not use --force to ignore errors. It is an
initial schema, not an upgrade script.

Check the result with the game account:

mysql -h localhost -u fftactics_trial -p fftactics_trial -e 'SHOW TABLES;'

You should see nine tables: players, admins, job_data, skills, objects,
ignore_data, help_data, global_settings, and shop_data.

5. Configure and compile

cp server.env.example server.env
chmod 600 server.env
nano server.env

Set the values to match the account you created:

FFT_DB_HOST='localhost'
FFT_DB_PORT='3306'
FFT_DB_NAME='fftactics_trial'
FFT_DB_USER='fftactics_trial'
FFT_DB_PASSWORD='YOUR_UNIQUE_DB_PASSWORD'
FFT_PORT='1234'
FFT_BIND_ADDRESS='127.0.0.1'
FFT_SKIP_INTRO='1'

The configuration uses POSIX shell syntax and is sourced by the launcher.
If your password contains an apostrophe, escape it correctly rather than
putting it unchanged inside single quotes. Keep server.env owner-controlled
and out of public downloads, web directories, and source-control commits.

For a local database, localhost uses the Unix socket. Set FFT_DB_SOCKET if
your host uses a nonstandard socket location. Remote databases require
matching host grants and connection settings from the database operator;
this guide creates a local account.

Build and check the database:

sh scripts/build.sh -j2
sh scripts/check-db.sh

The check should report:

Database connection and all nine table layouts: OK

That verifies the connection and columns. Creating and saving a character
is still needed to exercise the runtime write permissions.

6. Start and try the game

sh scripts/run.sh 1234

Leave that terminal open. For a private first test, open another terminal on
your own computer and forward the port over SSH. Substitute your login/server:

ssh -N -L 4000:127.0.0.1:1234 YOUR_LOGIN@YOUR_SERVER

For a nonstandard SSH port, add -p YOUR_SSH_PORT to that command. Connect your
MUD client to host 127.0.0.1, port 4000. Create a character using a unique game
password. Try commands, help commands, stats, items, say hello, and quit.
Log back in and check your character and inventory.

Ctrl+C stops the game. SIGINT and SIGTERM save connected players before exit.
Do not use kill -9 for a normal shutdown.

7. Allow public connections

Stop the test server and change these lines in server.env:

FFT_PORT='1234'
FFT_BIND_ADDRESS='0.0.0.0'

Start it again and check the listener:

ss -ltn | grep ':1234'

Look for 0.0.0.0:1234. Your hostname's DNS A record must point to your server's
public IPv4 address. Allow inbound TCP port 1234 in your server/provider firewall.
If you already use UFW, the rule is:

sudo ufw allow 1234/tcp

If the machine is behind a router, forward TCP 1234 to it too. Do not expose
MySQL port 3306 just to let people play; players connect to the game port.

For my installation, players connect to host mudhaven.net, port 1234.
Other operators should use their own hostname. This is a MUD/Telnet endpoint,
not an HTTP website address.

The game protocol is unencrypted. Use a unique game password; use an SSH
tunnel when you need an encrypted connection.

8. Keep it running after disconnecting from SSH

After stopping any foreground copy, start a tmux session:

tmux new -s fftacticsmud
sh scripts/run.sh 1234 >> log/server.log 2>&1

Press Ctrl+B, release both keys, then press D to detach. The game keeps running.
Return with tmux attach -t fftacticsmud. Inside the session, press Ctrl+C to
stop the game before restarting it. Read output with tail -n 80 log/server.log.

tmux survives SSH disconnects, but does not restart the game after a crash or
reboot. Watch log size and arrange log rotation for long-running installations.
Database errors deliberately stop the game so the underlying problem can be fixed.

9. Make your character an administrator

Create the character normally, then quit. In the administrator MySQL console,
replace Yourname with the character's actual name:

USE fftactics_trial;
INSERT INTO admins (name, wiz) VALUES ('Yourname', 'A');

Log back in and check commands. There is no default administrator account.
Deleting a character also removes its administrator entry.

MySQL error 1044: access denied to the database

This usually means MySQL accepted the login, but the account cannot access
the selected database. Check FFT_DB_NAME and FFT_DB_USER in server.env and
try the same login directly:

mysql -h localhost -u fftactics_trial -p fftactics_trial

As the MySQL administrator, inspect and correct the database-specific grant:

SHOW GRANTS FOR 'fftactics_trial'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON fftactics_trial.* TO 'fftactics_trial'@'localhost';

Use the actual names from your configuration. MySQL accounts include both user
and host; a grant for a different host/account may not fix this connection.
Do not grant access to every database or run the game as MySQL root.
Run sh scripts/check-db.sh again after correcting the grants or configuration.

Other problems

- Error 1045: wrong password, username, or account host; this is a login failure.
- Error 1049: the database name is wrong or the database does not exist.
- Error 1146: a table is missing; confirm the schema was imported into the
  same database the game uses.
- Column layout mismatch: use this release's schema in a fresh database.
  Legacy loaders depend on column order; do not rearrange columns.
- mysql_config / mariadb_config missing: install client development headers.
- openssl/evp.h missing: install the OpenSSL development package.
- Address already in use: stop the other copy or choose another game port.
- No outside connection: check that the game is running, its listener is
  0.0.0.0:1234, and DNS, firewalls, and router forwarding are correct.
- Missing maps/login text: upload the whole folder and use scripts/run.sh,
  which sets the required working directory.
- Compiler warnings: some old unused parameters and static tables still warn.
  For a build error, keep the full output, g++ --version, and cat /etc/os-release.

Backups

Use your database administrator's normal backup method. For a small installation
using a password-authenticated administrator, stop the game for a consistent
application-level backup, then run:

umask 077
mysqldump -u root -p --single-transaction --no-tablespaces fftactics_trial > fftactics-backup.sql

For socket-authenticated root, use this instead:

umask 077
sudo mysqldump --single-transaction --no-tablespaces fftactics_trial > fftactics-backup.sql

Keep backups private: they contain player records and password hashes. Restart
the game once the backup finishes. Do not put backups or server.env in a public ZIP.

Reference documentation

- Ubuntu MySQL development package: https://packages.ubuntu.com/noble/libmysqlclient-dev
- MySQL account setup: https://dev.mysql.com/doc/refman/8.0/en/creating-accounts.html
- MySQL GRANT: https://dev.mysql.com/doc/refman/8.0/en/grant.html

See TESTING.md for exact test coverage. The automated lifecycle test uses an
isolated MariaDB instance; it is not a requirement for running with MySQL.

— Liko