Redis是一個開源的使用ANSI C語言編寫、支持網(wǎng)絡(luò)、可基于 內(nèi)存 亦可持久化的日志型、Key-Value數(shù)據(jù)庫,并提供多種語言的API。從2010年3月15日起,Redis的開發(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兩個文件夾,我只是用64bit那個,主要的文件如下
????? ?redis-server.exe:服務(wù)程序
???????redis-check-dump.exe:本地數(shù)據(jù)庫檢查
???????redis-check-aof.exe:更新日志檢查
???????redis-benchmark.exe:性能測試,用以模擬同時由N個客戶端發(fā)送M個 SETs/GETs 查詢 (類似于 Apache 的ab 工具).
?????? redis-cli.exe? 客戶端,訪問服務(wù)程序的節(jié)點
3、體驗
(1)啟動服務(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ù)端的客戶端數(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)啟動客戶端
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號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
