MySQL Setup
Configure MySQL for cross-server skin synchronization on Velocity and BungeeCord networks.
Overview
MySQL is required when running ClothesPlus on a Velocity or BungeeCord network to synchronize player skins and wardrobe data across multiple backend servers.
MySQL is optional for single-server setups. ClothesPlus uses file-based storage by default.
Prerequisites
- A MySQL 5.7+ or MariaDB 10.3+ database server
- Network access from your Minecraft server(s) to the database
- A database user with CREATE, SELECT, INSERT, UPDATE, DELETE privileges
Configuration
Create a new database on your MySQL server:
```sql CREATE DATABASE clothesplus; CREATE USER 'clothesuser'@'%' IDENTIFIED BY 'your-secure-password'; GRANT ALL PRIVILEGES ON clothesplus.* TO 'clothesuser'@'%'; FLUSH PRIVILEGES; ```
Edit plugins/ClothesPlus/config.yml on each backend server:
```yaml config.yml mysql: enabled: true host: "your-mysql-host.com" port: 3306 database: "clothesplus" username: "clothesuser" password: "your-secure-password" pool-size: 10 use-ssl: false ```
If using Velocity or BungeeCord as a proxy:
```yaml config.yml velocity: enabled: true ```
For full functionality, install the ClothesPlusVelocity plugin on your proxy server. This ensures skin resets and updates are broadcast to all backend servers.
Restart each backend server. ClothesPlus will automatically create the required tables in the database.
Run /clothes mysql on each server to check the connection status.
Configuration Reference
| Setting | Default | Description |
|---|---|---|
enabled | false | Enable MySQL storage |
host | 127.0.0.1 | MySQL server hostname or IP |
port | 3306 | MySQL server port |
database | clothesplus | Database name |
username | clothesuser | Database user |
password | changeme | Database password |
pool-size | 10 | Connection pool size (increase for busy servers) |
use-ssl | false | Enable SSL for database connections |
Make sure all backend servers point to the same database with identical credentials. Mismatched configurations will cause sync issues.