Skip to main content

Getting started

Make sure to first set up your PlanetScale developer environment. Once you’ve installed the pscale CLI, you can interact with PlanetScale and manage your databases straight from the command line.

The keyspace command

This command allows you to view your keyspaces, create internal or external keyspaces, resize them, and view or update your Vitess VSchemas. This command is not available for Postgres databases. Usage:

Available sub-commands

* Flag is required

Sub-command flag descriptions

Available flags

Global flags

Examples

Create an external keyspace

Attach an existing MySQL database as an external keyspace on a production branch. --source-database is the remote MySQL database name, not the PlanetScale database. --cluster-size is optional; if you omit it, PlanetScale chooses a size from the source storage.
Check compatibility without creating the keyspace:
--dry-run reports connection failures and schema lint errors. A source can still be created if it connects, even when lint reports table-level errors.

Resize an external keyspace

Use the same resize command as an internal keyspace. Do not pass --additional-replicas.
You can also create and resize external keyspaces from the Clusters page in the dashboard.

Update tablet throttler settings

Update shard rollout concurrency

Set the maximum number of shards updated concurrently during keyspace configuration rollouts:
--max-rollout accepts values from 1 to 32. If the API value is not set, pscale keyspace settings displays not set, and PlanetScale uses the default of 1.

List read-only regions for a keyspace

Output includes each region’s slug, cluster size, and replica count. Use a region slug with pscale password create ... --read-only-region or pscale database dump ... --read-only-region.

Need help?

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