Redis常用命令与配置

栏目: 数据库 · 发布时间: 6年前

内容简介:测试客户端与服务器是否正常连接:ping正则获取键:keys pattern

常用命令

测试客户端与服务器是否正常连接:ping ( 补返回pong表示成功 )

正则获取键:keys pattern

Redis常用命令与配置

判断一个键是否存在: exist s key

删除一个键:del key

获取键的类型:type key

清空当前数据库:flushdb

返回一个键的剩余时间:ttl key ( 补:当 key 存在但没有设置剩余生存时间时,返回 -1 。当key不存在返回 -2 。)

设置一个键的剩余时间:expire key seconds

常用配置

配置文件在安装的根目录下,默认值如下:

端口 port=379

IP绑定 bind=0.0.0.0

数据库存放地址 dir=./

数据库名 dbfilename = dump.rdb ( 补:rdb redis简称 )

守护进程模式 daemonize = no

疑问查官网 https://redis.io/


以上所述就是小编给大家介绍的《Redis常用命令与配置》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Implementing Responsive Design

Implementing Responsive Design

Tim Kadlec / New Riders / 2012-7-31 / GBP 27.99

New devices and platforms emerge daily. Browsers iterate at a remarkable pace. Faced with this volatile landscape we can either struggle for control or we can embrace the inherent flexibility of the w......一起来看看 《Implementing Responsive Design》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码