Blogger Information
Blog 36
fans 1
comment 0
visits 29717
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
redis基础命令
Jason
Original
680 people have browsed it

redis安装与命令

redis安装

如果是windows安装,安装包百度搜索就会有。(个人建议还是不要从github下载,网速实在太慢)。

  1. 解压安装包,放到桌面。
  2. 打开命令行工具
  3. 使用命令行找到解压路径。
  4. 执行redis-server.exe

redis基础命令

redis是一个存储系统,主要存储的四种类型为:string(字符串),list(链表),set(集合),hash(哈希类型),不同的存储命令也不一样

string(字符串)命令

数据添加

set price 99

数据读取

get price
echo 99;

hash(哈希),类似于php的数组,在一个数组里面可以存储多个值

数据添加

hset category english 1
hset category chinese 2

数据读取

hget category english
echo 1

list(队列)

数据添加

lpush language c c++ php java

数据读取

lpop language(一次性弹出一个数据)

lrange language 1 2
echo c++ php

Correcting teacher:GuanhuiGuanhui

Correction status:qualified

Teacher's comments:可以写详细点!
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post