🚀 Get 25% off your first month on any plan! Use code MINT at checkout 🚀


← Go Back

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.

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
  2. Click on "Databases" in the left sidebar
  3. On the right side, click the "NEW DATABASE" button

Step 2: Configure Your Database

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

Step 3: Access Your Database Credentials

  1. Click on your newly created database to view its details
  2. You'll see important information including:
    • Database name
    • Username
    • Password
    • Hostname
    • Port

Connecting Your Plugin to the Database

Now that you've created your database, you need to configure your plugin to use it:

Step 1: Access Plugin Configuration

  1. Navigate to your plugin's configuration file using FTP or the file manager in your game panel
  2. Open the configuration file (usually config.yml) with a text editor

Step 2: Enter Database Details

  1. Locate the database configuration section in your plugin's config file
  2. Enter your database credentials:
    • 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")
  3. If the plugin has a toggle between MySQL and local storage, make sure to enable MySQL/database option

Step 3: Save and Restart

  1. Save the configuration file
  2. Restart your Minecraft server
  3. Check the console for any database connection messages
🚀 Launch Your Unlimited RAM Minecraft Server - Just $9.99/mo!

Common Database 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
  • Verify that special characters in passwords are properly escaped

Connection Refused

If your plugin can't connect to the database:

  • Verify the hostname and port are correct
  • Check if your hosting provider requires specific IP addresses in the "connections from" field
  • Ensure your server has network access to the database server

Performance Issues

If your server experiences lag after setting up a database:

  • Not all plugins benefit from MySQL - file-based storage may be faster for some plugins
  • Plugins that load all data at startup (like WorldGuard) often perform better with file storage
  • Economy plugins, logging plugins, and cross-server plugins benefit most from MySQL

By following this guide, you've successfully connected your Minecraft plugin to a MySQL database. This setup allows for better performance with certain plugins and enables cross-server functionality if you're running a network of servers.

← Go Back

The Last Minecraft Hosting You Will Ever Need!

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