How to Flush Data From Heroku Redis

April 1, 2018

Locally, you could flush a redis database with the following:

redis-cli
FLUSHALL

How can you accomplish the same on Heroku Redis? Here's how:

heroku redis:cli -a my_app --confirm my_app
FLUSHALL

Even better, here's a one-liner:

echo " FLUSHALL\r\n QUIT" | heroku redis:cli -a MY_APP --confirm MY_APP