{"id":12223,"date":"2026-06-02T08:12:44","date_gmt":"2026-06-02T08:12:44","guid":{"rendered":"https:\/\/make.wordpress.org\/test\/handbook\/get-setup-for-testing\/database-inspection\/"},"modified":"2026-06-08T19:12:47","modified_gmt":"2026-06-08T19:12:47","slug":"database-inspection","status":"publish","type":"handbook","link":"https:\/\/make.wordpress.org\/test\/handbook\/get-setup-for-testing\/database-inspection\/","title":{"rendered":"Database Inspection"},"content":{"rendered":"<p>Some test scenarios require checking or editing database rows directly. If you need a browser-based database tool for a local WordPress development environment, you can add phpMyAdmin to your <code>wordpress-develop<\/code> Docker setup.<\/p>\n<h2>Using phpMyAdmin<\/h2>\n<p>Create or update <code>docker-compose.override.yml<\/code> in the root of your local <a href=\"https:\/\/github.com\/WordPress\/wordpress-develop\">WordPress Develop<\/a> checkout. If you already use an override file for another local service, such as Mailpit, add <code>phpmyadmin<\/code> under the same <code>services<\/code> <span tabindex='0' class='glossary-item-container'>block<span class='glossary-item-hidden-content'><span class='glossary-item-header'>Block<\/span> <span class='glossary-item-description'>Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience.<\/span><\/span><\/span>.<\/p>\n<pre><code class=\"language-yaml\">services:\n  phpmyadmin:\n    image: phpmyadmin:latest\n    restart: unless-stopped\n    depends_on:\n      - mysql\n    ports:\n      - '8080:80'\n    environment:\n      PMA_HOST: mysql\n      PMA_USER: root\n      PMA_PASSWORD: password\n    networks:\n      - wpdevnet\n<\/code><\/pre>\n<p>Start the service with:<\/p>\n<pre><code class=\"language-bash\">docker compose up -d phpmyadmin\n<\/code><\/pre>\n<p>Then open http:\/\/localhost:8080 in your browser. This uses the default local database credentials from the WordPress development environment. The default database name is <code>wordpress_develop<\/code>.<\/p>\n<p>When you are finished, stop the service with:<\/p>\n<pre><code class=\"language-bash\">docker compose stop phpmyadmin\n<\/code><\/pre>\n<h2>When to Use Database Inspection<\/h2>\n<p>Use database inspection when a test case asks you to confirm stored values, check records created by a feature, or make a targeted database change as part of a reproduction. For most testing tasks, the WordPress admin screens, <span tabindex='0' class='glossary-item-container'>WP-CLI<span class='glossary-item-hidden-content'><span class='glossary-item-header'>WP-CLI<\/span> <span class='glossary-item-description'>WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is <a href=\"http:\/\/wp-cli.org\/\">http:\/\/wp-cli.org\/<\/a> <a href=\"https:\/\/make.wordpress.org\/cli\/\">https:\/\/make.wordpress.org\/cli\/<\/a><\/span><\/span><\/span>, and automated tests should be enough.<\/p>\n<nav class='o2-post-footer-actions'><ul class='o2-post-footer-action-row'><\/ul><div class='o2-post-footer-action-likes'><\/div><ul class='o2-post-footer-action-row'><\/ul><\/nav>","protected":false},"author":5911429,"featured_media":0,"parent":11179,"menu_order":40,"template":"","meta":{"footnotes":""},"class_list":["post-12223","handbook","type-handbook","status-publish","hentry","author-wordpressdotorg","make-database-inspection"],"revision_note":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/make.wordpress.org\/test\/wp-json\/wp\/v2\/handbook\/12223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/make.wordpress.org\/test\/wp-json\/wp\/v2\/handbook"}],"about":[{"href":"https:\/\/make.wordpress.org\/test\/wp-json\/wp\/v2\/types\/handbook"}],"author":[{"embeddable":true,"href":"https:\/\/make.wordpress.org\/test\/wp-json\/wp\/v2\/users\/5911429"}],"version-history":[{"count":2,"href":"https:\/\/make.wordpress.org\/test\/wp-json\/wp\/v2\/handbook\/12223\/revisions"}],"predecessor-version":[{"id":12246,"href":"https:\/\/make.wordpress.org\/test\/wp-json\/wp\/v2\/handbook\/12223\/revisions\/12246"}],"up":[{"embeddable":true,"href":"https:\/\/make.wordpress.org\/test\/wp-json\/wp\/v2\/handbook\/11179"}],"wp:attachment":[{"href":"https:\/\/make.wordpress.org\/test\/wp-json\/wp\/v2\/media?parent=12223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}