项目开发过程中,有时会用到 redis ,很尴尬的时候经常会忘记给 redis key 设置过期时间,这个时候需要我们通过命令行来操作进行删除。需要使用到如下语句:文章源自编程技术分享-https://mervyn.life/4939e5ea.html
redis-cli -h 127.0.0.1 -p 6379 -n 0 --scan --pattern "key_prefix_*" | xargs -L 5000 redis-cli -h 127.0.0.1 -p 6379 -n 0 DEL
文章源自编程技术分享-https://mervyn.life/4939e5ea.html 
我的微信公众号
微信扫一扫
评论