redis

2018-11-28  本文已影响0人  aq_wzj

1. 下载与安装

链接:https://pan.baidu.com/s/1jWowlZo9AewmVynl6KBKVA 密码:ru6w

2. 解决mysql的问题

  1. 查询的速度
    把数据存储到内存中

  2. 不需要提前定义好字段

3. NoSQL分类:

  1. memcache

    问题:

    • 数据存放到内存, 不能落地,持久化

    • 支持数据类型太少,只支持字符串

  1. MongoDB 默认端口11211

    • 数据存放到内存, 解决了数据的持久化
    • 支持多种数据类型
  2. redis默认端口6379

    • 数据存放到内存, 并且解决了数据的持久化

    • 支持5大数据类型格式

4. redis的启动:

  1. 在cmd里面找到服务端,启动, 可以将服务端设置为开机自动运行的那种

    D:\Redis-x64-3.2.100> redis-server.exe
    
    [12608] 27 Nov 21:20:10.678 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server.exe /path/to/redis.conf
                    _._
               _.-``__ ''-._
          _.-``    `.  `_.  ''-._           Redis 3.2.100 (00000000/0) 64 bit
      .-`` .-```.  ```\/    _.,_ ''-._
     (    '      ,       .-`  | `,    )     Running in standalone mode
     |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
     |    `-._   `._    /     _.-'    |     PID: 12608
      `-._    `-._  `-./  _.-'    _.-'
     |`-._`-._    `-.__.-'    _.-'_.-'|
     |    `-._`-._        _.-'_.-'    |           http://redis.io
      `-._    `-._`-.__.-'_.-'    _.-'
     |`-._`-._    `-.__.-'    _.-'_.-'|
     |    `-._`-._        _.-'_.-'    |
      `-._    `-._`-.__.-'_.-'    _.-'
          `-._    `-.__.-'    _.-'
              `-._        _.-'
                  `-.__.-'
    
    [12608] 27 Nov 21:20:10.683 # Server started, Redis version 3.2.100
    [12608] 27 Nov 21:20:10.684 * DB loaded from disk: 0.001 seconds
    [12608] 27 Nov 21:20:10.687 * The server is now ready to accept connections on port 6379
    
  1. 客户端连接

    再开一个cmd窗口

    D:\Redis-x64-3.2.100>redis-cli.exe
    127.0.0.1:6379>
    
1. 对于key的所有操作
2. 字符串操作
3. 链表操作

4. 集合set操作

5. 有序集合order set操作
6. Hash数据结构操作
上一篇 下一篇

猜你喜欢

热点阅读