Redis 常用命令
来源:互联网 发布:java自定义方法格式 编辑:程序博客网 时间:2024/04/28 17:16
启动 Redis 服务
src/redis-server或者src/redis-server redis.conf
vi /etc/rc.local, 加入代码:
src/redis-server或者src/redis-server redis.conf
src/redis-server redis.conf 1>log.log 2>errlog.log
1为标准输出,2为错误输出
vi /etc/rc.local, 加入代码:
/root/install/redis-2.4.9/src/redis-server
客户端连接
src/redis-cli
停止redis服务:
src/redis-cli shutdown
增删改查:
set abc
delete abc
get abc
keys *
取出当前匹配的所有key
> exists larry
(integer) 0
当前的key是否存在
del lv
删除当前key
expire
设置过期时间
> expire larry 10
(integer) 1
> move larry ad4
(integer) 1
移动larry键值对到ad4数据库
> persist lv
(integer) 1
移除当前key的过期时间
randomkey
随机返回一个key
rename
重命名key
type
返回值的数据类型
type testlist
list
> ping
PONG
测试连接是否还在
>echo name
"larry"
打印
> select ad4databank
OK
数据库切换
> quit
退出连接
> dbsize
(integer) 12
当前数据库中key的数量
> info
服务器基本信息
monitor
实时转储收到的请求
config get
获取服务器的参数配置
flushdb
清空当前数据库
flushall
清除所有数据库
原文地址:http://www.linuxidc.com/Linux/2012-03/57573.htm
0 0
- Redis常用命令
- redis常用命令
- redis常用命令
- redis常用命令
- redis常用命令
- Redis常用命令
- Redis常用命令
- redis常用命令
- Redis常用命令
- Redis常用命令
- redis常用命令
- Redis常用命令
- redis 常用命令
- redis常用命令
- redis常用命令
- redis 常用命令
- Redis常用命令
- Redis 常用命令
- OpenERP7.0 Domain条件表达式写法小结
- group by 和count的联合使用问题
- Baidu与Google地图API初探
- 自制Openerp图表
- Android Binder机制学习总结(三)-ServiceManager部分
- Redis 常用命令
- SQL子查询什么时候用
- Linux Shell 脚本攻略 ---- 第四章 让文本飞
- Brainly:走向全球的学生社交学习网络
- linux下的批量修改名称
- 开始学习编程了,此篇开题
- openerp用wizard导入excel数据
- 基于 Jenkins 快速搭建持续集成环境
- 1.6.1 3n+1问题 The 3n+1 problem