Navigation

PlanetScale environment set up

Table of Contents

Setup overview

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 install the PostgreSQL command-line client:
brew install postgresql

To upgrade to the latest version:

brew upgrade pscale

Linux instructions

pscale is available as downloadable binaries from the PlanetScale releases page.

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

The MySQL and PostgreSQL command-line clients can be installed via your package manager.

MySQL client:

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

PostgreSQL client:

  • Debian-based distributions:
sudo apt-get install postgresql-client
  • RPM-based distributions:
sudo yum install postgresql

Windows instructions

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

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

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.

MySQL client setup:

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"

PostgreSQL client setup:

The PostgreSQL command-line client is available from the PostgreSQL downloads page. After installation, you'll need to add the PostgreSQL bin directory to your PATH to use psql:

$env:path += ";C:\Program Files\PostgreSQL\17\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 PlanetScale 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 https://github.com/planetscale/cli

Install the MySQL or PostgreSQL Client

In either case, the MySQL or PostgreSQL client will need to be installed separately as well.

MySQL client: Refer to the official MySQL documentation and select the operating system you are working with.

PostgreSQL client: Refer to the official PostgreSQL documentation and select the operating 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.