# How to Use MySQL with Plugins on Your Minecraft Server (/docs/minecraft/use-mysql-database)



MySQL databases let plugins store data externally instead of in flat files. This is essential for multi-server setups (BungeeCord networks) and improves performance for data-heavy plugins.

Creating a Database [#creating-a-database]

<div className="fd-steps">
  <div className="fd-step">
    Open Databases [#1-open-databases]

    Access the [XGamingServer panel](https://panel.xgamingserver.com) and go to `Databases` in the sidebar.
  </div>

  <div className="fd-step">
    Create a new database [#2-create-a-new-database]

    Click **New Database**. Note the connection details:

    * **Host** (address)
    * **Port**
    * **Database name**
    * **Username**
    * **Password**
  </div>
</div>

Connecting Plugins [#connecting-plugins]

Example: LuckPerms [#example-luckperms]

Edit `plugins/LuckPerms/config.yml` via `Files`:

```yaml
storage-method: mysql
data:
  address: "your-db-host:3306"
  database: "your-db-name"
  username: "your-db-user"
  password: "your-db-password"
```

Example: EssentialsX [#example-essentialsx]

Edit `plugins/Essentials/config.yml`:

```yaml
economy:
  mysql:
    enabled: true
    host: "your-db-host"
    port: 3306
    database: "your-db-name"
    username: "your-db-user"
    password: "your-db-password"
```

Plugins That Support MySQL [#plugins-that-support-mysql]

| Plugin      | What It Stores                 |
| ----------- | ------------------------------ |
| LuckPerms   | Permissions, groups, user data |
| EssentialsX | Economy balances, homes        |
| CoreProtect | Block logging data             |
| DiscordSRV  | Account links                  |
| Dynmap      | Player data                    |

> 💡 **Tip:** MySQL is most valuable for BungeeCord/Velocity networks where multiple servers need to share the same data (permissions, economy, etc.).

> 📝 **Note:** For single-server setups, flat file storage (default) is fine. MySQL adds complexity without much benefit unless you have large amounts of data.

See also: [Import/Export MySQL](/docs/minecraft/import-export-mysql) | [Setup LuckPerms](/docs/minecraft/setup-luckperms)

If you need help, join our [Discord](https://discord.xgamingserver.com/).
