Run MySQL Query
mysql_queryRun SQL queries against the WordPress database. Read-only commands like SELECT and SHOW are always allowed; write operations require MYSQL_ALLOW_WRITES=true.
Instructions
Execute a SQL query against the WordPress database. SELECT, SHOW, DESCRIBE, and EXPLAIN are always allowed. INSERT, UPDATE, DELETE require MYSQL_ALLOW_WRITES=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Site name, ID, or domain. Uses env var if not specified. | |
| query | Yes | SQL query to execute (e.g., "SELECT * FROM wp_options WHERE option_name = 'siteurl'") |