Database Configuration
Configure database settings for SigmaOrders.
Database Typesโ
SigmaOrders supports two database types:
- SQLite (default) - File-based, no setup required
- MySQL - External database, better for large servers
SQLite Configurationโ
SQLite is the default and requires no additional configuration.
database:
type: SQLITE
SQLite Detailsโ
- File Location:
plugins/SigmaOrders/database.db - Setup: Automatic, no configuration needed
- Performance: Good for servers with < 200 players
- Limitations: Single-server only, file-based
SQLite Advantagesโ
- Zero configuration
- No external dependencies
- Fast for small-medium servers
- Easy backups (just copy the file)
SQLite Disadvantagesโ
- Slower with many concurrent operations
- File-based (can't share across servers)
- Limited scalability
MySQL Configurationโ
For larger servers or multi-server setups, use MySQL.
database:
type: MYSQL
mysql:
host: localhost
port: 3306
database: sigma_orders
username: root
password: your_password
pool-size: 10
MySQL Settingsโ
| Setting | Type | Default | Description |
|---|---|---|---|
host | String | localhost | Database server hostname |
port | Integer | 3306 | Database server port |
database | String | sigma_orders | Database name |
username | String | root | Database username |
password | String | password | Database password |
pool-size | Integer | 10 | Connection pool size |
MySQL Setup Stepsโ
-
Create Database
CREATE DATABASE sigma_orders CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -
Create User (optional, recommended)
CREATE USER 'sigmaorders'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON sigma_orders.* TO 'sigmaorders'@'localhost';
FLUSH PRIVILEGES; -
Configure Plugin
database:
type: MYSQL
mysql:
host: localhost
port: 3306
database: sigma_orders
username: sigmaorders
password: secure_password
pool-size: 10 -
Restart Server
- Plugin creates tables automatically
- Check console for connection success
MySQL Advantagesโ
- Better performance for large servers
- Can share database across multiple servers
- Better concurrent operation handling
- Professional database management tools
MySQL Disadvantagesโ
- Requires external database server
- More complex setup
- Additional resource usage
Connection Poolingโ
MySQL uses connection pooling for performance:
- pool-size: Number of concurrent connections (default: 10)
- Adjustment: Increase for high-traffic servers (max: 50 recommended)
- Monitoring: Check database connection count if issues occur
Database Migrationโ
SQLite to MySQLโ
-
Backup SQLite Database
cp plugins/SigmaOrders/database.db database.db.backup -
Export Data (if needed)
- Use SQLite tools to export data
- Import to MySQL (manual process)
-
Change Configuration
database:
type: MYSQL
# ... MySQL settings -
Restart Server
- Plugin creates MySQL tables
- Old SQLite file can be kept as backup
warning
Data migration from SQLite to MySQL is not automatic. You may need to manually export/import data or start fresh.
Database Maintenanceโ
SQLite Maintenanceโ
- Backup: Copy
database.dbfile - Vacuum: SQLite auto-vacuums, but can be done manually if needed
- Size: Monitor file size (grows with orders)
MySQL Maintenanceโ
- Backups: Use standard MySQL backup tools
- Optimization: Run
OPTIMIZE TABLEperiodically - Monitoring: Monitor connection pool usage
Troubleshootingโ
Connection Errorsโ
Symptoms: "Failed to connect to database"
Solutions:
- Verify database server is running
- Check host/port settings
- Verify username/password
- Check firewall rules
- Test connection with MySQL client
Performance Issuesโ
Symptoms: Slow order operations, timeouts
Solutions:
- Increase
pool-sizefor MySQL - Optimize database (indexes are auto-created)
- Consider MySQL for large servers
- Check database server resources
Permission Errorsโ
Symptoms: "Access denied" errors
Solutions:
- Verify database user has proper permissions
- Check GRANT statements
- Verify database name is correct