MySQL
The robomotion mysql CLI connects to MySQL databases for SQL operations. It executes queries and non-query statements, manages transactions with batch support, runs stored procedures, and handles full CRUD workflows.
When to use
- Execute SQL SELECT queries against MySQL tables
- Run INSERT, UPDATE, DELETE, and DDL statements
- Execute stored procedures with parameters
- Use batch transactions for atomic operations
Prerequisites
robomotionCLI installed- Package installed:
robomotion install mysql - MySQL connection credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install mysql - Connect with session:
robomotion mysql connect --session --output json # → {"outConnectionId":"<conn-id>","session_id":"<session-id>"} - Use the returned
conn-idandsession-idin all subsequent commands:robomotion mysql execute_query --conn-id "<conn-id>" --session-id "<session-id>" --output json - Disconnect when done:
robomotion mysql disconnect --conn-id "<conn-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion mysql backup_database --connection-id --backup-file-path [--opt-parameters] --session-id "<session-id>" --output jsonCreates a backup of the MySQL database to a filerobomotion mysql commit_transaction --transaction-id --output jsonCommits a database transaction to make all changes permanentrobomotion mysql connect [--opt-parameters] --session --output jsonConnects to a MySQL database server using Database credentialsrobomotion mysql disconnect --connection-id --session-id "<session-id>" --output jsonCloses an existing MySQL database connectionrobomotion mysql insert_table --connection-id --transaction-id --database-table --table [--opt-parameters] --session-id "<session-id>" --output jsonInserts table data into a MySQL database tablerobomotion mysql execute_non_query --connection-id --transaction-id --func [--opt-parameters] --session-id "<session-id>" --output jsonExecutes a SQL command that does not return data (INSERT, UPDATE, DELETE, etc.)robomotion mysql execute_query --connection-id --transaction-id --func [--opt-parameters] --session-id "<session-id>" --output jsonExecutes a SQL SELECT query and returns the results as a tablerobomotion mysql restore_database --connection-id --backup-file-path [--opt-parameters] --session-id "<session-id>" --output jsonRestores a MySQL database from a backup filerobomotion mysql start_transaction --connection-id [--opt-parameters] --session-id "<session-id>" --output jsonStarts a new database transaction for atomic operationsrobomotion mysql wait_column --connection-id --table [--opt-parameters] --session-id "<session-id>" --output jsonWaits until a new column is added to a specified tablerobomotion mysql wait_row --connection-id --table --sort-by [--opt-parameters] --session-id "<session-id>" --output jsonWaits until a new row is inserted into a specified tablerobomotion mysql wait_table --connection-id --table [--opt-parameters] --session-id "<session-id>" --output jsonWaits until a new table matching the pattern is created in the database
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)