Manage your database directly from the Playground CLI

Need to inspect WordPress data, debug a query, or check if a pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party. saved options correctly? The Playground CLICLI Command Line Interface. Terminal (Bash) in Mac, Command Prompt in Windows, or WP-CLI for WordPress. now includes a --phpmyadmin flag that launches phpMyAdmin alongside your local WordPress instance. No extra setup, no separate database server, just one command.

Where is your data?

When developing locally with Playground CLI, you often need to verify what the database actually contains. Until now, doing that required writing custom PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. https://www.php.net/manual/en/preface.php queries or adding debug output to your code.

The --phpmyadmin flag solves this by giving you a full phpMyAdmin interface right from the CLI.

Getting started

Add --phpmyadmin to your regular CLI command:

npx @wp-playground/cli@latest server --phpmyadmin

After WordPress boots, the CLI prints the phpMyAdmin URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org:

WordPress Playground CLI

PHP 8.3  WordPress latest
Extensions intl

Ready! WordPress is running on http://127.0.0.1:9400 (11 workers)

phpMyAdmin available at http://127.0.0.1:9400/phpmyadmin/index.php?route=/database/structure&db=wordpress

Open that URL in your browser, and you get full access to browse tables, run SQL queries, and inspect your WordPress data:

Custom URL path

By default, phpMyAdmin serves at /phpmyadmin. Change this path to anything you prefer:

npx @wp-playground/cli@latest server --phpmyadmin=/my-db

This serves phpMyAdmin at http://127.0.0.1:9400/my-db/index.php instead.

Combine with other CLI flags

The --phpmyadmin flag works alongside all existing CLI options:

Test a plugin and inspect its database changes

npx @wp-playground/cli@latest server --phpmyadmin --auto-mount

Run this from your plugin directory. Playground mounts your plugin automatically, and phpMyAdmin lets you verify the database tables and options your plugin creates.

Pin a specific WordPress and PHP version

npx @wp-playground/cli@latest server --phpmyadmin --wp=latest --php=8.5

Useful when you need to check how your plugin handles data across different WordPress versions.

Use a Blueprint with phpMyAdmin

npx @wp-playground/cli@latest server --phpmyadmin --blueprint=my-blueprint.json

Combine Blueprints with phpMyAdmin to pre-configure your WordPress instance and then inspect the resulting database state.

Cache phpMyAdmin for faster starts

Each time you use --phpmyadmin, Playground downloads and installs phpMyAdmin into the instance. To skip the download on subsequent runs, mount a local directory to cache the files:

mkdir -p ./pma-cache
npx @wp-playground/cli@latest server --phpmyadmin --mount ./pma-cache:/tools/phpmyadmin

The first run populates ./pma-cache with the phpMyAdmin files. On every subsequent run, Playground detects the existing installation and skips the download.

Where this helps

Here are some practical scenarios where --phpmyadmin saves time:

  • Plugin development: Verify that your plugin creates the correct custom tables and stores data in the expected format.
  • Debugging options: Check wp_options directly to confirm your plugin settings saved correctly, without writing get_option() debug code.
  • Content migrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. testing: Import content via a Blueprint and verify the resulting posts, terms, and metadata in the database.
  • Learning WordPress internals: Explore how WordPress organizes its database tables — see how posts relate to postmeta, how taxonomies link to terms, and how user data connects across tables.
  • SQL query testing: Run raw SQL queries against your test data before embedding them in your plugin code.

How it works under the hood

phpMyAdmin installs at /tools/phpmyadmin on the virtual filesystem — outside the WordPress document root at /wordpress. The CLI uses a path alias (similar to NginxNGINX NGINX is open source software for web serving, reverse proxying, caching, load balancing, media streaming, and more. It started out as a web server designed for maximum performance and stability. In addition to its HTTP server capabilities, NGINX can also function as a proxy server for email (IMAP, POP3, and SMTP) and a reverse proxy and load balancer for HTTP, TCP, and UDP servers. https://www.nginx.com/.’s alias directive) to serve it at your chosen URL path. This design keeps phpMyAdmin files separate from your WordPress installation, so they never appear in site exports or interfere with your project files.

Since Playground uses SQLite instead of MySQLMySQL MySQL is a relational database management system. A database is a structured collection of data where content, configuration and other options are stored. https://www.mysql.com/., phpMyAdmin connects through a custom MySQL-on-SQLite driver that translates queries between the two dialects.

Share your feedback

The phpMyAdmin integration in the CLI came from the same effort that brought the Database panel to the Playground web interface. If you run into issues or have suggestions, share them on the Making WordPress Slack or open an issue on GitHub.

Props to @JanJakes for reviewing this post.