Redis: Mac: install and config

Redis install and config in Mac


1. Download

https://redis.io/
download redis-5.0.4.tar.gz


2. Make

~ tar xzf redis-5.0.4.tar.gz
~ sudo mv redis-5.0.4 /usr/local
~ cd /usr/local/redis-5.0.4

~ make

if you see: It’s a good idea to run ‘make test’
then, make command run success!


3. Set password 123456

~ vi redis.conf
/requirepass

# requirepass foobared  -->  requirepass 123456

4. Config environment variable

~ cd ~
~ vi .bash_profile
export PATH=/usr/local/redis-5.0.4/src:$PATH
~ source .bash_profile

5. Start server

~ redis-server /usr/local/redis-5.0.4/redis.conf

6. Start client

~ redis-cli
127.0.0.1:6379> get aa
(error) NOAUTH Authentication required.
127.0.0.1:6379> set aa xx
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123
(error) ERR invalid password
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> get aa
"aa"
127.0.0.1:6379>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章