DEV Community

Shivansh Tuteja
Shivansh Tuteja

Posted on

How to Delete Supabase Database using Supabase Cli

Step 1 : Install Supabase CLI using npm

standard installation

npm install -g supabase
Enter fullscreen mode Exit fullscreen mode

I personally use

npx supabase ...
Enter fullscreen mode Exit fullscreen mode

Step 2 : Login to Supabase CLI

npx supabase login
Enter fullscreen mode Exit fullscreen mode

Step 3: Link Your Project

It's time to connect your local setup to your Supabase project. For this, you'll need your project's reference ID. This assumes you have already run supabase init in your project and have a configuration. If you haven't it'll prompt you to run that command first.

You can find the project ref in your Supabase dashboard (it's that long string of letters and numbers).

npx supabase link --project-ref YOUR_PROJECT_REF_ID
Enter fullscreen mode Exit fullscreen mode

Replace YOUR_PROJECT_REF_ID with your actual project reference ID.

Step 4 : Reset the DB

supabase db reset --linked

### Step 5 : Lets Discuss
Ways to avoid reseting database after migration failure 😂
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay