avatar

Catalog
redis的基本用法

Redis的基本用法

redis在命令行下的使用

Redis的安装

shell
1
sudo apt-get install redis

简单运用

Code
1
2
3
4
localhost:6379> set pi 3.14
OK
localhost:6379> get pi
"3.14"

redis的常见命令

redis有5种数据类型

  • String
  • List
  • Hash(字典)
  • Set
  • Sorted Set

字符串操作
| 命令 | 作用 |
| ————————– | —- |
| append|在字符串后追加 |
| incr |数字+1 |
| incrby key [num] |数字+xxx |

List操作

Author: Jacob
Link: http://yoursite.com/2020/02/03/redis%E7%9A%84%E5%9F%BA%E6%9C%AC%E7%94%A8%E6%B3%95/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Donate
  • 微信
    微信
  • 支付寶
    支付寶