How To Create A MySQL Database For Your Game Server

Learn how to create and manage MySQL databases for your game server for plugin and mod data storage.

By the GhostCap teamUpdated

Many game server plugins and mods use a MySQL database to store data such as player stats, economy systems, and permissions. Here's how to create and manage databases in the GhostCap Panel.

Creating a Database

  1. Access the GhostCap Panel and select your server.
  2. At the bottom of your server's page, under Advanced, click Databases.
  3. Click New database.
  4. Enter a Database name and choose the Allowed connections: Any IP address, or Specific IP addresses with the addresses allowed to connect.
  5. Click Create database.

Copy the database name, host, username, and password shown on the database card into your plugin's or mod's configuration file. Use the full database name shown in the panel, which includes a prefix for your server. Refer to the plugin's documentation for the specific field names.

Tip

The MySQL port is always 3306.

Danger

Deleting a database permanently removes all data stored in it. Server backups don't include databases, so use Export to keep a copy of your own. A deleted database can't be restored.

Exporting a Database

  1. Access the GhostCap Panel and select your server.
  2. At the bottom of your server's page, under Advanced, click Databases.
  3. Click Export and select the database you want to download.

The export downloads as a .sql.gz file.

Importing a Database

You can import a .sql or .sql.gz file of up to 100 MB into a new database.

  1. Access the GhostCap Panel and select your server.
  2. At the bottom of your server's page, under Advanced, click Databases.
  3. Click Import, enter a Database name and choose the Allowed connections.
  4. Drop your file into the upload area, or select it with Browse Files.
  5. Click Import.

If an import fails, the window shows the error and, when it can, the line of the file where it stopped.

Resetting Your Database Password

  1. Access the GhostCap Panel and select your server.
  2. At the bottom of your server's page, under Advanced, click Databases.
  3. Click the reset password icon on the database card, then click Reset password.

After resetting, update the password in any plugin or mod configuration files that use this database.

Connection Strings

The copy connection string icon on the database card copies a MySQL connection URL with the host, port, database name, and credentials. If your plugin accepts this format, you can paste it into its configuration.

Java plugins that need a JDBC URL (common on Minecraft) use the form jdbc:mysql://HOST:3306/DATABASE. Replace HOST and DATABASE with the values shown in the panel, and enter the username and password where your plugin's documentation says.