Sharing Player Data Across a Network With MySQL
On a single server, SQLite is fine. The moment a second server joins the network, shared data needs a database both servers can actually reach.
Sharing Player Data Across a Network With MySQL
A player's balance shouldn't reset just because they switched from the survival server to the minigame server.
Most plugins default to SQLite — a local file-based database that works fine for a single server. The problem shows up the moment a network has more than one backend server behind a proxy: SQLite files aren't shared between machines (or even between separate processes on the same machine), so each server ends up with its own disconnected copy of player data.
When This Actually Matters
If every backend server behind the proxy is meant to share one economy, one set of permissions, or one set of player stats, each plugin managing that data needs to point at the same MySQL database — not its own local SQLite file.
Setting Up MySQL
Install MySQL (or MariaDB) on a server reachable by every backend — this can be one of the backend servers itself, or a separate dedicated database host for a larger network.
sudo apt install mysql-server
sudo mysql_secure_installationCreate a database and a user for the network to use:
CREATE DATABASE minecraft_network;
CREATE USER 'mcnetwork'@'%' IDENTIFIED BY 'a-real-password-here';
GRANT ALL PRIVILEGES ON minecraft_network.* TO 'mcnetwork'@'%';
FLUSH PRIVILEGES;Pointing Plugins at MySQL Instead of SQLite
Most plugins that support both (LuckPerms, several economy plugins) have a storage-method setting in their config:
storage-method: MySQL
data:
address: 'db-host:3306'
database: 'minecraft_network'
username: 'mcnetwork'
password: 'a-real-password-here'The exact config keys vary by plugin — this is the general shape, not a copy-paste for every plugin.
Do This on Every Backend Server
The same MySQL connection details need to go into the matching config on every backend server in the network — pointing only one server at MySQL while the rest stay on SQLite defeats the entire purpose.
Securing the Database
A MySQL instance reachable from multiple backend servers also needs to not be reachable from the open internet:
- Bind MySQL to a private network interface, or firewall port
3306to only the backend servers' IPs - Use a real, unique password — not the database name or something equally guessable
- Avoid granting the network user privileges beyond what it actually needs (
ALL PRIVILEGESon one specific database is more contained than a global grant)
Testing It Worked
Join one backend server, change something tracked by the shared database (a balance, a permission), then switch to a different backend server through the proxy and confirm the change carried over. If it didn't, double-check every server is actually pointed at the same database and credentials — a typo in one server's config is the most common cause of "it's still not syncing."