获取Redis所有Key的方法:

1. 终端

获取所有Key命令:redis-cli keys ‘*’  ;

获取指定前缀的key:redis-cli KEYS “edu:*”

如果需要导出,可以redis-cli keys ‘*’ > /data/redis_key.txt

删除指定前缀的Key    redis-cli KEYS “edu:*” | xargs redis-cli DEL

 

2. PHP获取Redis所有Key

获取Redis所有Key:$keys = $redis->keys(‘*’);

获取指定前缀的Key:$keys = $redis->keys(‘edu*’);

删除指定前缀的Key :$redis->delete($redis->keys(‘image*’));

 

相关命令参考

Redis  KEYS   http://doc.redisfans.com/key/keys.html

 

 

 

 

 

 

6 个评论

  1. 您的评论正在等待审核。

    Hi,

    I won slots !!! 100% Deposit Match up to $300 !!!
    Slot casino games for free word games, new online casinos for us players bonus. slot o pol mega jack free slot games
    https://gamesforrealmoney.blogspot.com/2020/11/slotebi-ufasod-ufaso-slotebi-ufaso-slot.html
    Free online vegas slots no download android, biggest no deposit welcome bonus korean drama. яндекс игры казино
    https://slotgamesforpc.blogspot.com/2020/11/blog-post_63.html
    How to win online casino slots monopoly, slot machine games online to win cash. игра 007 казино рояль
    https://slotgamesplayfree.blogspot.com/2020/12/slot-v-online-com-4d-slot-v.html
    Welcome bonus casino no deposit zip file, empire city casino yonkers open again showing. лучшие игры слоты казино
    https://slotgamesplayfree99.blogspot.com/2021/01/blog-post_12.html
    Best no deposit bonus codes 2020 to use, big slot wins at casinos near me. система игры казино
    https://slotmachinejackpots2020.blogspot.com/2021/01/5-5.html
    Online gambling for real money on slot machines, free casino slot games 2019 zynga poker. настоящие игровые автоматы онлайн
    https://slotmachinesforsale.blogspot.com/2021/01/joker-casino.html
    Linq hotel and casino slot machine videos 2020, how to win black jack x reader. drop ставки на спорт
    https://stavki999.blogspot.com/2020/12/blog-post_612.html
    How do online casino bonuses work with venmo, how to play roulette just cause 4. лига ставок онлайн регистрация
    https://stavkinasportoline.blogspot.com/2020/10/blog-post_62.html
    https://bit.ly/36KztAu http://bit.ly/3pA2y89 https://bit.ly/3n8IJnz
    By continuing to browse the site install anything since offers than other real money gambling.

发表评论

电子邮件地址不会被公开。 必填项已用*标注