Skip to content

Instantly share code, notes, and snippets.

@dimasch
Last active May 7, 2024 08:29
Show Gist options
  • Save dimasch/57b7cee3f7f9d274253d to your computer and use it in GitHub Desktop.
Save dimasch/57b7cee3f7f9d274253d to your computer and use it in GitHub Desktop.
Clear a redis cache in Docker
docker exec -it container-name redis-cli FLUSHALL
@kang8
Copy link

kang8 commented Jan 26, 2022

If you want to clear cache from a specific database, you can run:

docker exec -it container-name redis-cli -n database-number flushdb

@N-Ganesh
Copy link

Thank you

@yomguy
Copy link

yomguy commented Jul 25, 2022

👍

@FelipeFinger
Copy link

Thank You! ❤️ ❤️

@giavinh79
Copy link

If password required (otherwise you will get Authentication required error) can just use this:
docker exec -it container-name redis-cli -a password FLUSHALL

@mrkiril
Copy link

mrkiril commented Nov 25, 2022

THNK a lot

@shayangha
Copy link

good

@jose16-21
Copy link

gracias !!

@Natgho
Copy link

Natgho commented Feb 24, 2023

Teşekkürler bro!!

Copy link

ghost commented May 31, 2023

thank you!

@riotsnotdiets
Copy link

Works, thanks! <3

@mcspronko
Copy link

Thanks!

@kamarton
Copy link

kamarton commented Aug 8, 2023

Works, but also gives me a failed to resize tty, using default size warning.

Better to use -i instead of -it:

docker exec -i container-name redis-cli FLUSHALL

-it parameter can be omitted:

docker exec container-name redis-cli FLUSHALL

@jhasudungan
Copy link

Thank You

@legito-dev
Copy link

Thank you!

@RobertoCodeEye
Copy link

it works!!, thank you!!

@gouz7514
Copy link

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment