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.

Postgres

Create role credentials with pscale role, then connect using a connection string.pscale connect is not supported.

Vitess / MySQL

Create a branch password with pscale password, then connect with a connection string or pscale connect.

The connect command

This command creates a secure connection to a database branch for a local client. It is supported for Vitess/MySQL databases only; to connect to a Postgres database, use a connection string with a role. Usage:
If there is only one branch available on the database, you can leave off <BRANCH_NAME>.

Available flags

Available roles for the --role flag are:
  • reader
  • writer
  • readwriter
  • admin

Global flags

Examples

The connect command with --execute flag

Command:
Output: This command connects to the specified PlanetScale branch and runs the node app.js command. Since no --execute-env-url flag was passed, it uses the default DATABASE_URL environment variable. You can find a full example of this in our Node quickstart.

Need help?

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