官網:
Redis是一個開源的NoSQL資料庫,以一個key對應一個value的方式並配合記憶體(RAM)來儲存資料,效能要比關聯式資料庫還要好很多,可以在許多程式語言上使用。Redis的value除了字串(string)型態之外,另外還有幾種比較特殊的結構,包括set、zset、list和hash,並提供了多種方式來操作這些欄位。
For Windows:
似乎不支援Windows...於是…
[料理佳餚] 在 Windows 上安裝 Redis:
https://dotblogs.com.tw/supershowwei/2015/12/23/124549
https://github.com/MSOpenTech/redis/releases
For Mac:
自己compile http://www.jianshu.com/p/6b5eca8d908b
用homebrew http://www.jianshu.com/p/af33284aa57a
For ubuntu:
Ubuntu如何架設Redis Server並且與PHP一同使用?
https://magiclen.org/ubuntu-redis-php/
等有空再來玩玩~
上次沒辦法完成的connect-redis總是遺憾吶
Using Redis to handle Session in Node.js
https://codeforgeek.com/2015/07/using-redis-to-handle-session-in-node-js/
http://wiki.jikexueyuan.com/project/node-lessons/cookie-session.html
查詢Redis的方式 For MAC
連線到Redis Server:
telnet [Redis Server IP] [Redis Server Port]
列出所有的Key值:
keys *
取得該key的value值:[key]表示keys *取得的key值
get [key]
離線Redis:control+]
離線Telnet:quit
參考︰https://www.tipga.com/e/569de3913286fe25f5001a89
加入驗證密碼︰
Redis - 修改設定檔 redis.windows-service.conf
搜尋 SECURITY 並加入
requirepass 你要的密碼
重啟Redis Server
NodeJS - 加入pass參數
app.use(session({ // 參考︰https://github.com/tj/connect-redis store: new redisStore({ 'host':'Redis Srever IP', 'port':'6379', 'pass':'你要的密碼' }), resave: true, saveUninitialized: true, secret: 'keyboard cat', cookie: { maxAge: 60 * 60 * 1000 } }))
Console - 使用auth指令
auth 你的密碼
留言
張貼留言