Skip to content

PlanetScale environment set up

Use the PlanetScale CLI to create development branches, make non-blocking schema changes, and open deploy requests directly from your terminal.

Setup overview

To interact with PlanetScale and manage your databases, you can use the pscale CLI to do the following:

  • Create, delete and list your databases and branches
  • Open a secure MySQL shell instance
  • Manage your deploy requests
  • ...and more!
Note

pscale can use the MySQL command-line client to quickly open an interactive shell for a database branch. Optional instructions for installing the MySQL client can be found for each platform below.

macOS instructions

To install the PlanetScale CLI on macOS, we recommend using Homebrew.

How to install or verify Homebrew is on your computer:

  1. Open Terminal.
  2. Check if you have Homebrew installed by running the following command:
Copied
brew -v
  1. If you don't see "Homebrew" and a version number, then download and install Homebrew.
  2. Once you've installed Homebrew, repeat Step 2 to verify.

Installing via Homebrew

  • Run the following command:
Copied
brew install planetscale/tap/pscale
  • To install the MySQL command-line client:
Copied
brew install mysql-client

Linux instructions

pscale is available as downloadable binaries from the releases page.

Download the .deb or .rpm from the releases page and install with sudo dpkg -i and sudo rpm -i respectively.

The MySQL command-line client can be installed via your package manager.

  • Debian-based distributions:
Copied
sudo apt-get install mysql-client
  • RPM-based distributions:
Copied
sudo yum install community-mysql

Manually

Download the pre-compiled binaries from the releases page and copy to the desired location.

Instructions for installing the MySQL client on other Linux distributions can be found in the official documentation.

Windows instructions

On Windows, pscale is available via scoop, and as a downloadable binary from the releases page:

Copied
scoop bucket add pscale https://github.com/planetscale/scoop-bucket.git
scoop install pscale

To upgrade to the latest version:

Copied
scoop update pscale

Installation via binary Download the latest Windows release and unzip the pscale.exe file into the folder of your choice. Then, run it from PowerShell or whatever terminal you regularly use.

The MySQL command-line client is available in the Windows MySQL Installer. To launch pscale shell you will need to have the mysql.exe executable's directory in your shell's PATH.

In PowerShell, add that directory to your current shell's PATH:

Copied
$env:path += ";C:\Program Files\MySQL\MySQL Server 8.0\bin"

Using the PlanetScale CLI

See all available commands by running:

Copied
pscale --help

Verify that you're using the latest version:

Copied
pscale version

You're all set! Check out our CLI reference page to explore all that's possible with the PlanetScale CLI.

Need help?

Get help from PlanetScale's support team, or join our GitHub Discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on May 3, 2022
Help us improve this page
PrivacyTerms© 2022 PlanetScale Inc.