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
- Access the GhostCap Panel and select your server.
- At the bottom of your server's page, under
Advanced, clickDatabases. - Click
New database. - Enter a
Database nameand choose theAllowed connections:Any IP address, orSpecific IP addresseswith the addresses allowed to connect. - 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.
The MySQL port is always 3306.
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
- Access the GhostCap Panel and select your server.
- At the bottom of your server's page, under
Advanced, clickDatabases. - Click
Exportand 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.
- Access the GhostCap Panel and select your server.
- At the bottom of your server's page, under
Advanced, clickDatabases. - Click
Import, enter aDatabase nameand choose theAllowed connections. - Drop your file into the upload area, or select it with
Browse Files. - 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
- Access the GhostCap Panel and select your server.
- At the bottom of your server's page, under
Advanced, clickDatabases. - 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.
