Linux Redis官方API和常用命令
来源:互联网 发布:系统架构图 软件 编辑:程序博客网 时间:2024/05/16 15:18
详细可参考官方api :http://doc.redisfans.com/
启动 Redis 服务
src/redis-server或者src/redis-server redis.confsrc/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
清除所有数据库
0 0
- Linux Redis官方API和常用命令
- linux下redis和mongo常用命令
- 操作linux redis 常用命令
- linux下redis常用命令
- Redis配置和常用命令
- Redis配置和常用命令
- Redis配置和常用命令
- Redis数据类型和常用命令
- Redis安装和常用命令
- redis 介绍和常用命令
- Redis配置和常用命令
- redis学习日志六(api-hash常用命令)
- 查看redis状态和redis常用命令
- redis 安装配置和常用命令
- redis 简单官方脚本安装方法(linux)
- linux下操作redis数据库的常用命令
- Spring+SpringMVC+MyBatis+easyUI整合进阶篇(九)Linux下安装redis及redis的常用命令和操作
- redis学习日志七(api-列表的常用命令)
- 怎样写出优秀的研究论文?
- [LeetCode] Flatten Nested List Iterator
- wmf和emf格式的图片有什么区别? JPG图片如何转换WMF文件?
- WebStrom中的一些技巧和用法
- 定时器SetTimer如何用在win32控制台用用程序中
- Linux Redis官方API和常用命令
- LNMP-php-fpm参数优化
- iOS UIView中坐标转换
- Xcode7 UITableView 的numberOfRowsInSection 多次(3次)调用
- iMAC——U盘全新重装Mac系统
- 使用 Spark Streaming 检测关键词
- struts之Cookie会话保持
- jsp中的在线编辑器
- 设置textfield输入框输入内容上下限 (字符数量)