CentOS7安装Redis并设置DesktopManager远

2017-02-10  本文已影响367人  别瞄我
整个大致流程: 安装 —> 启动 —> 设置密码AUTH —> 连接

1.yum源安装

# yum install redis

2.启动redis

# systemctl start redis //CentOS7.*方式
或者
# service redis start //CentOS6.*方式

3.设置密码AUTH

# cd /usr/bin
# redis-cli

输入下面两条命令后,如下图:

照理说现在就可以在本地使用redis命令了,但是通常我们有项目不在本地或者有时需要用DesktopManager工具远程连接使用redis,而redis默认只能本地使用,所以需要做如下操作:
1.设置密码AUTH
2.设置不限IP访问(或者限定你指定的IP访问)

(error) ERR Client sent AUTH, but no password is set  //说明没设置密码```
```127.0.0.1:6379> auth mypass  //设置密码,将 mypass 替换成你要设置的密码即可
 OK```
```127.0.0.1:6379> quit```

找到redis配置文件
```# cd /etc/```
```# vi redis.conf```
找到 bind 127.0.0.1 在最前面加上#号保存后即可(或者将 127.0.0.1 换成你指定的IP),如下图

![](https://img.haomeiwen.com/i3515296/dfa007bf7ed50e6f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

#### 4.连接

![](https://img.haomeiwen.com/i3515296/2536ba379a912465.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
上一篇下一篇

猜你喜欢

热点阅读