redis常用命令
来源:互联网 发布:淘宝小样能买到正品吗 编辑:程序博客网 时间:2024/04/30 15:56
启动 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
增删改查:
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
清除所有数据库
- Redis常用命令
- redis常用命令
- redis常用命令
- redis常用命令
- redis常用命令
- Redis常用命令
- Redis常用命令
- redis常用命令
- Redis常用命令
- Redis常用命令
- redis常用命令
- Redis常用命令
- redis 常用命令
- redis常用命令
- redis常用命令
- redis 常用命令
- Redis常用命令
- Redis 常用命令
- org.xml.sax.SAXParseException The content of element type "package" must match "(result-types?,inter
- Jqgrid入门-结合Struts2+json实现数据展示(五)
- Git常用命令
- OSGI事务处理
- android通过Jsoup解析Html表格
- redis常用命令
- 如何在FTP软件中显示隐藏文件,如.htaccess?
- Apache Maven 使用 profile 和 filtering 实现多种环境下的资源配置管理(属性过滤)
- 关于jqgrid显示中文乱码问题
- 金额数据从小写转换为大写
- UBUNTU学习(二)之文件与用户属性
- log4j
- 图的创建
- eclipse插件的配置(SVM、TOMCAT)