修改redis.conf文件
NETWORK标签下: 将bind 127.0.0.1加上注释,(#bind 127.0.0.1),允许出本机外的IP访问redis 将protected-mode yes,修改为protected-mode no;不保护redis
GENERAL标签下: 将daemonize no,修改为daemonize yes;允许redis服务后台运行
SECURITY标签下: requirepass xxxx 开启密码
重新启动redis,重启redis的时候一定要制定配置文件,不然修改后的配置文件是没有发挥作用的 redis-server /usr/local/etc/redis.conf