<p class="md-end-block md-p"> Redis 可以支持如下连接方式:通过客户端工具连接、通过数据库管理工具 DMC 连接等。</p> <p class="md-end-block md-p">连接远程</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded"> redis-cli -h 47.101.63.222 -p 56379</pre><div class="contentsignin">登录后复制</div></div><p class="md-end-block md-p">连接本地</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded"> redis-cli</pre><div class="contentsignin">登录后复制</div></div><p class="md-end-block md-p">设置密码</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded"> config set requirepass pass_123456</pre><div class="contentsignin">登录后复制</div></div><p class="md-end-block md-p">获取密码</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded"> config get requirepass</pre><div class="contentsignin">登录后复制</div></div><p class="md-end-block md-p">登录</p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded"> auth pass_123456</pre><div class="contentsignin">登录后复制</div></div>