Redis是一個(gè)開(kāi)源的使用ANSI C語(yǔ)言編寫(xiě)、支持網(wǎng)絡(luò)、可基于 內(nèi)存 亦可持久化的日志型、Key-Value數(shù)據(jù)庫(kù),并提供多種語(yǔ)言的API。從2010年3月15日起,Redis的開(kāi)發(fā)工作由VMware主持。
?
1、下載 https://github.com/dmajkic/redis/downloads ;由于我電腦是win7 64bit 所以下載
?????? redis-2.4.5-win32-win64.zip ?— Redis-2.4.5 - Windows binaries (win32 and x64 included)
2、壓縮包下載后,我解壓到桌面上,看到32bit和64bit兩個(gè)文件夾,我只是用64bit那個(gè),主要的文件如下
????? ?redis-server.exe:服務(wù)程序
???????redis-check-dump.exe:本地?cái)?shù)據(jù)庫(kù)檢查
???????redis-check-aof.exe:更新日志檢查
???????redis-benchmark.exe:性能測(cè)試,用以模擬同時(shí)由N個(gè)客戶(hù)端發(fā)送M個(gè) SETs/GETs 查詢(xún) (類(lèi)似于 Apache 的ab 工具).
?????? redis-cli.exe? 客戶(hù)端,訪(fǎng)問(wèn)服務(wù)程序的節(jié)點(diǎn)
3、體驗(yàn)
(1)啟動(dòng)服務(wù)端
[4392] 01 Apr 13:27:59 * Server started, Redis version 2.4.5
[4392] 01 Apr 13:27:59 # Open data file dump.rdb: No such file or directory
[4392] 01 Apr 13:27:59 * The server is now ready to accept connections on port 6379??????????????? //服務(wù)端的端口
[4392] 01 Apr 13:28:00 - 0 clients connected (0 slaves), 1179896 bytes in use??????????????????????????? //顯示連接服務(wù)端的客戶(hù)端數(shù)量
[4392] 01 Apr 13:28:06 - 0 clients connected (0 slaves), 1179896 bytes in use
[4392] 01 Apr 13:28:11 - 0 clients connected (0 slaves), 1179896 bytes in use
[4392] 01 Apr 13:28:17 - 0 clients connected (0 slaves), 1179896 bytes in use
(2)啟動(dòng)客戶(hù)端
C:\Users\Administrator\Desktop\Redis\redis-2.4.5-win32-win64\64bit>redis-cli.exe?-h localhost -p 6379??? //localhost可以換為服務(wù)器的IP地址,127.0.0.1
(3)操作
redis localhost:6379> set wil "Niu"
OK
redis localhost:6379> get wil
"Niu"
redis localhost:6379> lpush "Be"
(error) ERR wrong number of arguments for 'lpush' command
redis localhost:6379> lpush friends "be"
(integer) 1
redis localhost:6379> get wil
"Niu"
redis localhost:6379> lrange friends 0 -1
1) "be"
redis localhost:6379> lrange friends 0 -2
(empty list or set)
redis localhost:6379> lrange friends get friends
1) "be"
redis localhost:6379> exists wil
(integer) 1
redis localhost:6379>
……
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
