MySQL Setup
RocketPlaceholders supports MySQL for synchronizing placeholders across multiple servers. This allows you to manage placeholders centrally and have them automatically sync to all your servers.Overview
With MySQL synchronization, you can:- Manage placeholders from a single server
- Automatically sync placeholders to all connected servers
- Keep placeholder data consistent across your network
How It Works
- Main Server - One server is designated as the “main” server. This server stores placeholders in the MySQL database.
- Other Servers - Other servers connect to the same MySQL database and retrieve placeholders from it.
- Synchronization - When placeholders are updated on the main server, they’re automatically available to all other servers.
Configuration
Step 1: Fill Connection Information
Configure your MySQL connection settings:Step 2: Choose a Main Server
Main Server Configuration:Step 3: Create the Database
Create the MySQL database (if it doesn’t exist):Step 4: (Re)Start the Server
After configuring MySQL, restart your server. RocketPlaceholders will connect to the database and sync placeholders.How Placeholders Work with MySQL
Main Server
On the main server:- Placeholders from the
placeholdersfolder are copied to the database - Any changes to placeholders are saved to the database
- The database is the source of truth
Other Servers
On other servers (wheremain: false):
- Placeholders are loaded from the MySQL database
- Placeholders from the local
placeholdersfolder are also loaded - Database placeholders take priority
Using Only Database Placeholders
If you want to use only database placeholders (no local placeholders), simply delete all placeholders from the localplaceholders folder:
Common Questions
What is the difference between MySQL and YML?
With MySQL, you can sync placeholders across multiple servers. With YML (local storage), placeholders are only available on the server where they’re created.What is a Main Server?
The main server is the server that stores placeholders in the database. All other servers read placeholders from the database. Only one server can be the main server.Will MySQL cause lag?
No, MySQL synchronization is optimized and won’t cause noticeable lag. All database operations are performed asynchronously.If I use MySQL, are the config’s placeholders read?
Yes! If the server is not a main server, you’ll have:- Placeholders from the database (from the main server)
- Placeholders from the local config file
How can I delete all config placeholders to use only database placeholders?
Simply delete all placeholders from your localplaceholders folder:
Troubleshooting
Q: Can’t connect to MySQLA: Check:
- MySQL server is running
- IP address and port are correct
- Username and password are correct
- Database exists
- Firewall allows connections
- MySQL user has proper permissions
A: Make sure:
- MySQL is enabled on all servers
- Main server is set correctly (only one server with
main: true) - All servers are connected to the same database
- Servers have restarted after configuration
A: Remember:
- Only make changes on the main server
- Changes on non-main servers won’t sync
- Restart servers after making changes
Best Practices
- Backup your database - Regularly backup your MySQL database containing placeholders
- One main server - Always have exactly one server set as main
- Test locally first - Test placeholder changes on the main server before expecting them on other servers
- Monitor connections - Keep an eye on MySQL connection logs to ensure all servers are connecting properly
Related Guides
- MySQL FAQ - Frequently asked questions about MySQL
- Configuration - General configuration guide
- Custom Placeholders - Creating placeholders