在百度搜索并下载安装Redis Desktop Manager。Redis Desktop Manager是免费的软件。

redis绑定外网端口 redismanager连接redis_服务器

  1. 打开软件,并点击左上角的【连接到Redis服务器】。
  2. 打开新增服务器窗口,输入名称、地址、密码(如果Redis服务器需要密码)后测试连接并保存。
  3. 保存好后,在左侧打开刚刚添加好的连接,如果连接正常就可以看到Redis服务器的数据啦。你可以通过该工具添加修改删除数据。操作起来还是很方便的。

redis没有实现访问控制这个功能,但是它提供了一个轻量级的认证方式,可以编辑redis.conf配置来启用认证。

   1、初始化Redis密码:

   在配置文件中有个参数: requirepass  这个就是配置redis访问密码的参数;

   比如 requirepass test123;

   (Ps:需重启Redis才能生效)

   redis的查询速度是非常快的,外部用户一秒内可以尝试多大150K个密码;所以密码要尽量长(对于DBA 没有必要必须记住密码);

   2、不重启Redis设置密码:

   在配置文件中配置requirepass的密码(当redis重启时密码依然有效)。

   redis 127.0.0.1:6379> config set requirepass test123

   查询密码:

   redis 127.0.0.1:6379> config get requirepass
   (error) ERR operation not permitted

   密码验证:

   redis 127.0.0.1:6379> auth test123
   OK

   再次查询:

   redis 127.0.0.1:6379> config get requirepass
   1) "requirepass"
   2) "test123"

   PS:如果配置文件中没添加密码 那么redis重启后,密码失效;

   3、登陆有密码的Redis:

   在登录的时候的时候输入密码:

   redis-cli -p 6379 -a test123

   先登陆后验证:

   redis-cli -p 6379

   redis 127.0.0.1:6379> auth test123
   OK

   AUTH命令跟其他redis命令一样,是没有加密的;阻止不了攻击者在网络上窃取你的密码;

   认证层的目标是提供多一层的保护。如果防火墙或者用来保护redis的系统防御外部攻击失败的话,外部用户如果没有通过密码认证还是无法访问redis的。

账号默认是root

如果启用了保护模式,Redis运行在保护模式

Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

由于启用了保护模式,Redis运行在保护模式,没有指定绑定地址,没有向客户端请求认证密码。在这种模式下,只接受来自loopback接口的连接。如果你想从外部电脑连接到Redis,你可以采用以下一种解决方案:1)只要禁用保护模式发送命令'CONFIG SET protected-mode no'从环回接口连接到Redis从服务器运行的同一主机,但是,如果你这样做,确保Redis不是公开从互联网访问。使用CONFIG REWRITE使此更改永久性。2)或者,你可以通过编辑Redis配置文件来禁用保护模式,并将保护模式选项设置为'no',然后重新启动服务器。3)如果你手动启动服务器只是为了测试,用'——protected-mode no'选项重新启动它。4)设置绑定地址或认证密码。注意:为了让服务器开始接受来自外部的连接,您只需要做上面的一件事。