Database Setup

Database Setup

BusyMining stores player data (levels, Zeta, upgrades, statistics, runes, cooldowns) and Artifact Identifier slots in a database. Everything else, like Vessel levels, lives on the items themselves.

yaml
database:
  enabled: true
  type: sqlite
  host: localhost
  port: 3306
  database: busymining
  username: root
  password: ""
  pool-size: 10
  connection-timeout: 5000

SQLite (default)

With type: sqlite, data goes to plugins/BusyMining/busymining.db. Nothing to set up. The connection settings below are ignored.

MySQL

Set type: mysql and fill in the connection:

  • host, port: the MySQL server.
  • database: the schema to use. Create it first; BusyMining creates its tables inside it.
  • username, password: an account with create, alter, select, insert and update rights on that schema.
  • pool-size: maximum connections in the pool.

Any type other than sqlite is treated as MySQL. The connection uses useSSL=false.

Tables

BusyMining creates two tables on first start:

Table Holds
mining_players One row per player: level, XP, Zeta, statistics, upgrades, Singularity, stored runes, Oracle cooldowns, settings
mining_artifact_slots The Artifact Identifier slots of every player

When an update adds a column, it's added to the existing table on startup. Nothing is dropped.

Settings not read

database.enabled and database.connection-timeout are not read in this version. The database is always on, and the connection timeout is fixed at 10 seconds.

Changing settings

Database settings are read at startup only, so restart after changing them. /mine reload does not reconnect.

Switching between SQLite and MySQL starts with an empty database; existing data is not copied over. Back up busymining.db before switching on a live server.

Saving

Player data is loaded when a player joins, kept in memory while they're online, and saved:

  • every Settings.AutoSaveSeconds (300 by default) in modules/core/config.yml,
  • when they quit,
  • when the server stops.

All database work runs off the main thread.