What is MySQL Commands? MySQL Commands is a lightweight yet powerful plugin that allows you to run
any server-side command directly from your
MySQL database.
It was built for use with
webshops,
external integrations, and
custom backend systems that need to communicate with your Minecraft server in real time.
How does it work? This plugin checks a MySQL table for new entries containing commands to be executed.
When it finds a matching row (targeted at a specific player or global), it
executes the command from the console, and marks it as
done = 1.
✅ Example Use Cases
A webshop (e.g. Tebex, own e-shop, etc.) inserts a command into MySQL → the plugin executes it when the player is online
External systems can reward players, assign ranks, send messages, or execute any command – all through a shared MySQL DB
⚙️ Table structure
id - Unique ID of the request
wait_for_player - 1 =
wait until player is online, 0 = run
anytime for_uuid - Target player's UUID
(can be null if wait_for_player = 0) for_nick - Target player's name
(can be null if wait_for_player = 0) cmd - Command to execute via console
info - Optional info/description
done - Mark as completed (
done = 1)
done_timestamp - When it was done
timestamp - When the row was created
Configuration options (config.yml) check-interval: 5 - Interval (in seconds) to check DB for new commands
check-player-by: "UUID" - "UUID" or "NAME" – how to match the player
Why use this plugin? ✅ Decouples command control from Minecraft ✅ Ideal for e-commerce / payment gateways ✅ UUID or Name-based execution ✅ Works with offline or online players ✅ Logs executions with timestamps ✅ Lightweight & easy to configure
Before its done:
After command execution:
Notify message (/mysqlcmds notify)
Create table:
Code (Text):
CREATE TABLE `mysql_cmds` (
`id` int NOT NULL AUTO_INCREMENT,
`wait_for_player` tinyint(1) NOT NULL DEFAULT '0',
`for_uuid` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`for_nick` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`cmd` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`done` tinyint(1) NOT NULL DEFAULT '0',
`done_timestamp` timestamp NULL DEFAULT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
Add row:
Code (Text):
INSERT INTO `mysql_cmds` (`id`, `wait_for_player`, `for_uuid`, `for_nick`, `cmd`, `info`, `done`, `done_timestamp`, `timestamp`) VALUES (NULL, '1', '03dea68f-c6ea-462c-91ad-cd56b4dbbb01', 'Dj_Nejk', 'lp user Dj_Nejk parent set vip', 'Set VIP rank', '0', NULL, CURRENT_TIMESTAMP);
##############################################
# Checking incoming rows in DB for user by UUID or his Name:
check-player-by: "UUID" # (UUID/NAME)
##############################################
# Prefix using placeholder {prefix}
prefix: "&8[&4&l{#55ff55}M{#55ff80}y{#55ffaa}S{#55ffd5}Q{#55ffff}L{#ffffff}C{#e3e3e3}m{#c6c6c6}d{#aaaaaa}s&8]"
reload-message: "{prefix} &8» &a✅ MySQL Commands plugin has been reloaded."
nopermission-message: "{prefix} &8» &c❌ You don't have permission."
reload-use-message: "{prefix} &8» &7Usage: &f/mysqlcmds reload"
notify-use-message: "{prefix} &8» &7Usage: &f/mysqlcmds notify"
notify-message: "{prefix} &8» &7Command executed for player &f{player}&7:\n&f{plaincmd}\n&7 " # (Placeholders: {player} - player name, {uuid} - player uuid, {cmd} - command, {plaincmd} - command in plain text => things like &, {#00ff00}, ... will be displayed)
notify-console-message: "Command executed for player {player}: {plaincmd}" # (Placeholders: {player} - player name, {uuid} - player uuid, {plaincmd} - command in plain text => things like &, {#00ff00}, ... will be displayed)
notify-enable: "{prefix} &8» &7Notifications have been &2enabled&7."
notify-disable: "{prefix} &8» &7Notifications have been &4disabled&7."
##############################################
##############################################
# List (local database) of players who receive notifications using /mysqlcmds notify
notify-users: []