redis centos安装

下载:http://download.redis.io/releases/

解压Redis安装包

tar -zxvf redis-3.2.9.tar.gz

安装

cd redis-3.2.9

Make

cd src

make install PREFIX=/usr/local/redis

移动配置文件到安装目录下

cd ../

mkdir /usr/local/redis/etc

mv redis.conf /usr/local/redis/etc

配置redis为后台启动

vi /usr/local/redis/etc/redis.conf //将daemonize no 改成daemonize yes

 

vi /usr/local/redis/etc/redis.conf // requirepass 123456

开启redis

/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

 

连接Redis客户端

./redis-cli -h 127.0.0.1 -p 6379 -a "123456"

关闭redis

./redis-cli -h 127.0.0.1 -p 6379 -a "123456"  shutdown

修改redis.conf

注释掉bind 127.0.0.1 开启外网访问

你可能感兴趣的:(数据库)