Skip to content

Database Setup

ItsNotSkyeZ edited this page Jul 14, 2026 · 1 revision

Database Setup

EndlessCoinflip supports three storage types. Set your choice in config.yml:

storage:
  type: FILE   # FILE, SQLITE, or MYSQL

FILE (Default)

No setup required. Player data is saved as individual YAML files in plugins/EndlessCoinflip/playerdata/.

Best for: small servers or those who want simple, human-readable data files.


SQLite

A single-file database stored locally on your server. No external database server needed.

storage:
  type: SQLITE

The database file is created automatically at plugins/EndlessCoinflip/data.db.

Best for: medium servers that want better performance than flat files without the complexity of MySQL.


MySQL

A full external database server. Suitable for networks or servers that already run MySQL.

storage:
  type: MYSQL
  mysql:
    host: localhost
    port: 3306
    database: endlesscoinflip
    username: root
    password: yourpassword

✅ EndlessCoinflip will create the database automatically if it doesn't already exist — no manual setup needed beyond having a MySQL server running.

Best for: large servers or networks sharing data across multiple instances.


Migrating Between Storage Types

When you change the type in config and run /cf reload (or restart), EndlessCoinflip will automatically:

  1. Read all existing data from the current storage
  2. Write it into the new storage
  3. Rename the old storage as a backup (never deleted) For example, switching from FILE to SQLite will rename playerdata/ to playerdata_backup/ and import everything into data.db.

⚠ Always keep your own backups before switching storage types, especially on production servers.


Troubleshooting

SQLite crashes on startup Make sure you're running Java 21+. Some older Java versions have issues with the SQLite driver.

MySQL connection refused

  • Check your host, port, username and password are correct
  • Make sure your MySQL server allows remote connections if not running locally
  • Check your firewall isn't blocking port 3306

Clone this wiki locally