redis 安装

传送门:https://www.runoob.com/redis/redis-install.html

http://download.redis.io/releases/redis-5.0.5.tar.gz

# 安装步骤:
tar -zxvf redis-5.0.5.tar.gz
cd redis-5.0.5
make && make install PREFIX=/usr/local/redis
mkdir /etc/redis
cp redis.conf /etc/redis/redis.conf

vi /etc/redis/redis.conf
注释掉 bind 127.0.0.1 将daemonize no -> daemonize yes

保护模式:protected-mode yes -> protected-mode no

密码:
# requirepass foobared
requirepass Redis666


# 启动:
cd /usr/local/redis/bin
./redis-server /etc/redis/redis.conf

# 停止
./redis-cli -p 6379 shutdown

# 测试:

./redis-cli

127.0.0.1:6379> keys *
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth Redis666
OK

posted @ 2020-03-30 10:04  悟空为师想要吃肉  阅读(102)  评论(0)    收藏  举报