Run SQL queries against the WordPress development database. Use when querying database tables, inspecting Simple History events, checking WordPress data, or debugging database issues.
You are tasked with running SQL queries against the WordPress development database.
CLAUDE.local.md under "Database Access"docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "YOUR_SQL_HERE"
Refer to CLAUDE.local.md for the actual credentials and connection details.
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "SHOW TABLES;"
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "SELECT * FROM wp_simple_history ORDER BY id DESC LIMIT 10;"
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "DESCRIBE wp_simple_history;"
docker compose exec mariadb mysql -u<USER> -p<PASSWORD> <DATABASE> -e "SELECT COUNT(*) FROM wp_posts;"
The database contains multiple WordPress installations with different prefixes:
| Prefix | Installation |
|---|---|
wp_ | Main install (wordpress_mariadb) |
wp_nightly_ | Nightly build |
wp_6_0_ to wp_6_6_ | Version-specific installs |
wp_multisite_ | Multisite install |
wp_php74_ | PHP 7.4 install |
wp_subfolder_ | Subfolder install |
The main Simple History tables (using wp_ prefix):
wp_simple_history - Main events tablewp_simple_history_contexts - Event context/metadataCLAUDE.local.md\G at the end for vertical output