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!

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:

    brew -v
  3. If you don't see "Homebrew" and a version number, then download and install Homebrew.

  4. Once you've installed Homebrew, repeat Step 2 to verify.

Installing via Homebrew

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

To upgrade to the latest version:

brew upgrade pscale

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:
sudo apt-get install mysql-client
  • RPM-based distributions:
sudo yum install community-mysql

Windows instructions

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

scoop bucket add pscale
scoop install pscale mysql

To upgrade to the latest version:

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:

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

Manual setup (any OS)

If you prefer to manually install the pscale binary for your operating system, the following two methods may be used.

Download the binary

Download the pre-compiled binaries from the releases page and download the binary for your operating system to the desired location. The binary may be run using the terminal of your choice from that location.

Install using bin

bin is a cross-platform tool to manage binary files. You can install the pscale CLI using bin with the following command:

bin install

Install the MySQL Client

In either case, the MySQL client will need to be installed separately as well. To do so, refer to the official documentation and select the operation system you are working with.

Using the PlanetScale CLI

See all available commands by running:

pscale --help

Verify that you're using the latest version:

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 the PlanetScale support team, or join our GitHub discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on Help us improve this page