LIMITED TIME OFFER: 25% off your first month — use code


 
 
 
 
Knowledgebase MintServers Game Panel How to Connect MySQL Database to Minecra...

How to Connect MySQL Database to Minecraft Plugins

Setting up a MySQL database for your Minecraft plugins improves performance, enables cross-server data sharing, and enhances your server's capabilities. This step-by-step guide shows you exactly how to create and connect a MySQL database to your Minecraft plugins through your hosting panel, with no technical experience required.

🚀 Launch Your Unlimited RAM Game Server — Just $9.99/mo!

Creating Your MySQL Database

Follow these simple steps to create a new database for your Minecraft plugins:

Step 1: Access the Database Section

  1. Log into your MintServers game panel and click on Databases in the left sidebar.
  2. Databases Menu
  3. On the right side of the page, click the NEW DATABASE button.
  4. New Database Button

Step 2: Configure Your Database

  1. Enter a name for your database in the text field.
  2. Leave the "connections from" field empty (this allows connections directly from your server).
  3. Click Create to finalize your database.
  4. Create Database Prompt

Step 3: Access Your Database Credentials

Click on your newly created database to view its details. You will see important information that you need to copy down for your plugins:

  • Database name
  • Username
  • Password
  • Hostname
  • Port
View Database Details Database Credentials

Connecting Your Plugin to the Database

Now that you have created your database, you need to configure your plugin to use it.

Step 1: Access Plugin Configuration

  1. Navigate to your plugin's configuration folder using the Files tab in your game panel.
  2. Open the configuration file (usually named config.yml) with the text editor.

Step 2: Enter Database Details

Locate the database configuration section in your plugin's config file and enter your credentials. If the plugin has a toggle between MySQL and local storage, make sure to enable the MySQL/database option.

  • Username: Make sure to use quotes (e.g., username: "s1255_admin").
  • Password: Always use quotes (e.g., password: "84a8sd4d+&1*").
  • Hostname: Include the port (e.g., hostname: "127.0.0.1:3306").
  • Database: Your database name (e.g., database: "s1255_database").

Step 3: Save and Restart

  1. Save the configuration file by clicking the save button at the top of the editor.
  2. Head back to the Console and Restart your Minecraft server.
  3. Check the console log as it boots up for any successful database connection messages!

🛠️ Troubleshooting Connection Issues

Authentication Failed: If you see authentication errors in your console, double-check your username and password for typos. Ensure all credentials are properly enclosed in quotes and verify that special characters in passwords are properly escaped.

Connection Refused: Verify the hostname and port are exactly correct. Check if your hosting provider requires specific IP addresses in the "connections from" field, and ensure your server has network access to the database.

Performance Issues: If your server experiences lag after setting up a database, keep in mind that not all plugins benefit from MySQL. Plugins that load all data at startup (like WorldGuard) often perform better with standard file storage. Economy plugins, logging plugins, and cross-server plugins usually benefit the most from MySQL.

No worries if your plugin still refuses to connect to the database! Just open a support ticket and our team will gladly jump in and instruct you on how to resolve the configuration.

Was this article helpful?

The Last Minecraft Hosting You Will Ever Need!

Unlimited Slots, Unlimited RAM, One-Click Mods & Plugins