redis常用命令行的使用
官网命令行介绍:https://redis.io/commands/
redis命令手册:https://redis.com.cn/commands.html
连接本地:
redis-cli
连接远端:
redis-cli -h host -p port -a password
redis默认有15 个库 标识分别是0-15
select 1
set key value
get key
dbsize 键值总数
检查key是否存在
exists key
删除
del key
设置过期时间
expire key seconds
获取key剩余过期时间 返回值-1说明没有设置过期时间, -2 则表示过期
ttl key
返回key数据类型
type key
这里只做简单介绍了,更多命令 点击查看。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有