I have 2 keyspaces in my redis server:
db0:keys=1,expires=0
db1:keys=36679593,expires=0
But if I run
redis-cli KEYS '*'
I only get keys in db0. How can i search the keys in db1?
You can use redis-cli
with the -n
option;
$ redis-cli -n 1 KEYS '*'
$ redis-cli --help
redis-cli 2.6.7
Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
...
-n <db> Database number
...
first, you need to select the db1
. To do that use select 1
.
Then you can get all keys using KEYS *
select 1 // selects db 1
keys * // search all keys in selected db (db -1 )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With