推荐文章
-
https://www.cnblogs.com/codersay/p/4301677.html
-
https://blog.csdn.net/yjqyyjw/article/details/73293455
-
https://blog.csdn.net/u011132987/article/details/79744558
-
https://blog.csdn.net/lyl0724/article/details/78559815
-
https://blog.csdn.net/u010889616/article/details/79736368
-
https://blog.csdn.net/cn_lyg/article/details/78109940
-
https://blog.csdn.net/yiruai/article/details/79093256
-
https://www.cnblogs.com/zsg88/p/8323475.html
-
https://www.cnblogs.com/silent2012/p/4157728.html
-
https://blog.csdn.net/u013519290/article/details/73196370
-
http://blog.51cto.com/ultrasql/1656492
-
https://blog.csdn.net/mrqiang9001/article/details/80212803
-
https://blog.csdn.net/mrqiang9001/article/details/80295261
安装步骤:
mkdir /usr/local/redis
cd /usr/local/redis
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
ls
tar xzf redis-5.0.5.tar.gz
检查是否安装GCC,如果未安装则需要安装(GCC安装命令 yum install gcc或yum install gcc-c++) gcc -v
cd redis-5.0.5
make
mkdir /usr/redis
cd src
make install PREFIX=/usr/redis
cd /usr/local/redis/redis-5.0.5
cp redis.conf /usr/redis
cd /usr/redis
ls
bin/redis-server redis.conf
Ctrl+C
vim redis.conf
找到daemonize no,daemonize 是守护进程,把no改为yes,并保存退出 (搜索 :/daemonize)
#requirepass foobared 去掉注释修改密码 requirepass 你的密码
bind 127.0.0.1 这一行注释掉(这里的bind指的是只有指定的网段才能远程访问这个redis。 注释掉后,就没有这个限制了)
protected-mode 要设置成no (1、关闭protected-mode模式,此时外部网络可以直接访问 2、开启protected-mode保护模式,
需配置bind ip或者设置访问密码)
并保存退出
bin/redis-server redis.conf
bin/redis-cli
auth 你的密码,然后回车
set name sikefeng
get name
config get requirepass
bin/redis-server redis.conf
bin/redis-cli
get name
exit (退出mysql命令行)
bin/redis-cli shutdown 关闭redis服务器
*****************配置开机自启Redis************************
mkdir /etc/redis
cd /etc/redis
复制 6379.conf 到当前文件夹
vim 6379.conf
#requirepass foobared 去掉注释修改密码 requirepass 你的密码
并保存退出
cd /etc/init.d
复制 redisd 到当前文件夹
chmod 755 redisd
/etc/init.d/redisd start 启动测试
reboot linux重开机