Skip to main content

Get started

The PlanetScale web console can be used to query to any database branch; however, it is disabled for production branches by default to protect production data. To access the web console, navigate to a database, and click on the “Console” tab in the page navigation. From here, you can select which branch you’d like to connect to by selecting it in the dropdown and clicking “Connect”. Once you have accessed the web console, you can run queries against your database branch, or apply DDL to branches without safe migrations enabled. The following are examples of MySQL statements you may find useful within the web console: Use SHOW TABLES; to see a list of the tables in your database branch. Use DESCRIBE table_name; to obtain information about a given table’s structure. Use EXPLAIN in front of SELECT, DELETE, INSERT, REPLACE and UPDATES statements to learn how the database is executing a query. This can be useful for optimizing slow queries.

Primary and replica connections

After connecting to a branch, use the Server dropdown in the console header to choose which node to connect to:
  • Primary — Connect to the primary node. Use this for read and write queries.
  • Replica — Connect to a read replica. The console uses read-only credentials on replica connections.
If a branch has no replicas, the console connects to the primary and the Replica option is unavailable. Switching between primary and replica reconnects the console and clears the current output.

Supported console commands

CommandDescription
?, \?Synonym for help
clear, \cClear the current input statement
help, \hDisplay list of commands
ego, \GSend command to server
go, \gSend command to server

Enable for production branches

By default, the web console is disabled for production branches to prevent accidental data loss. You can enable the web console for production branches on the “Settings” page for the given database, app.planetscale.com/<org>/<database>/settings. Select the checkbox for “Allow web console access to production branches”, then scroll down and click the “Save database settings” button to save your changes. This will enable the ability to use the web console to run queries against production branches for the given database.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.