Redis常用命令
来源:互联网 发布:c语言用函数判断素数 编辑:程序博客网 时间:2024/06/06 06:54
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 Key value;
get key;
del key;
exists key;
keys *
取出当前匹配的所有key
h?llo 匹配 hello
h*llo 匹配 hllo 和 heeeeello 等
h[ae]llo 匹配 hello 和 hallo ,但不匹配 hillo
> 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 常用命令
- 分类问题 boosting思想
- 简单易懂实例说明如何设计子网掩码
- linux下tomcat启动正常,工程却无法访问
- 安装WAMPServer,提示could not execute menu item internal error
- 拼接SQL语句缺少“break”
- Redis常用命令
- 【bzoj1864】 ZJOI2006 三色二叉树 水题
- Tomcat,JBoss与JBoss Web
- django搭建微信后台——获取用户信息(7.20)
- eclipse下开发hadoop程序配置(二)
- 二叉树的存储表示与实现
- 算法(第四版)学习笔记之java实现栈和队列(链表实现)
- python 入门(一)
- win7的path原始变量值在我设置java的环境变量时不小心被删掉了