多的不谈,现附上Windows版本Redis的下载路径:链接:
https://pan.baidu.com/s/1_Vc9KsJC5Jg8wnTqHqlHzA
提取码:3nr9
启动服务redis-server.exe,然后启动redis客户端redis.cli.exe
127.0.0.1:6379> set name 'ay'
OK
127.0.0.1:6379> get name
"ay"
127.0.0.1:6379> set name 'al'
OK
127.0.0.1:6379> get name
"al"
127.0.0.1:6379> del name
(integer) 1
127.0.0.1:6379> del name
(integer) 0
127.0.0.1:6379> exists name
(integer) 0
127.0.0.1:6379> lpush userlist 'al''ay'
Invalid argument(s)
127.0.0.1:6379> lpush user 'al' 'bl'
(integer) 2
127.0.0.1:6379> lrange user 0 -1
1) "bl"
2) "al"
127.0.0.1:6379> rpush user 'love'
(integer) 3
127.0.0.1:6379> lpush user 'hope'
(integer) 4
127.0.0.1:6379> lrange user 0 -1
1) "hope"
2) "bl"
3) "al"
4) "love"
127.0.0.1:6379> lset user 0 'wish'
OK
127.0.0.1:6379> lrange user 0 '-1'
1) "wish"
2) "bl"
3) "al"
4) "love"
127.0.0.1:6379> lrem user 0
(error) ERR wrong number of arguments for 'lrem' command
127.0.0.1:6379> lrem user 0 'wish'
(integer) 1
127.0.0.1:6379> lrange user 0 '-1'
1) "bl"
2) "al"
3) "love"
127.0.0.1:6379>
测试一下redis支持的几种数据类型,然后开始集成到项目中
鉴于Redis服务本身不占用太多内存,所以推荐自启。
命令行窗口下:在redis的目录下执行(执行后就作为windows服务了)
redis-server --service-install redis.windows.conf