当前位置:网站首页>Redis设置密码
Redis设置密码
2022-06-23 06:23:00 【qq_37279783】
一.第一种方式 (当前这种linux配置redis密码的方法是一种临时的,如果redis重启之后密码就会失效,)
(1)首先进入redis,如果没有开启redis则需要先开启:
[[email protected] bin]# redis-cli -p 6379
127.0.0.1:6379>
(2)查看当前redis有没有设置密码:
127.0.0.1:6379> config get requirepass
- “requirepass”
- “”
(3)为以上显示说明没有密码,那么现在来设置密码:
127.0.0.1:6379> config set requirepass abcdefg
OK
127.0.0.1:6379>
(4)再次查看当前redis就提示需要密码:
127.0.0.1:6379> config get requirepass
(error) NOAUTH Authentication required.
127.0.0.1:6379>
2.第二种方式 (永久方式)
需要永久配置密码的话就去redis.conf的配置文件中找到requirepass这个参数,如下配置:
修改redis.conf配置文件
requirepass foobared 改为
requirepass 123 指定密码123
保存后重启redis就可以了。
边栏推荐
- 900. RLE 迭代器
- pspnet完整代码实现
- JS dynamically creates a href circular download file. Only 10 or a fixed number of files can be downloaded
- 318. 最大单词长度乘积
- [daily training] 513 Find the value in the lower left corner of the tree
- js 判断两个数组增加和减少的元素
- 初始化层实现
- GIS实战应用案例100篇(七十九)-多规整合底图的制作要点
- Advanced drawing skills of Excel lecture 100 (VIII) -excel drawing WiFi diagram
- 启发式的搜索策略
猜你喜欢

MySQL(八) — 执行计划(Explain)详解

Intentional shared lock, intentional exclusive lock and deadlock of MySQL

深度学习系列47:styleGAN总结

MySQL redo log redo log

Analysis of personalized learning progress in maker Education

启发式的搜索策略

直播回顾 | 传统应用进行容器化改造,如何既快又稳?

Configuration and compilation of mingw-w64, msys and ffmpeg

都是硬盘分区 C盘和D盘到底有什么区别?

Project_ Filter to solve Chinese garbled code
随机推荐
How to achieve efficient network information dissemination
315. 计算右侧小于当前元素的个数
直播回顾 | 传统应用进行容器化改造,如何既快又稳?
System permission program cannot access SD card
Mysql(十一) — MySQL面试题整理
407-栈与队列(232.用栈实现队列、225. 用队列实现栈)
897. incremental sequential search tree
如何在 PHP 中进行日期格式验证检查(正则)
Unet代码实现
[bull Chinese document] queue package used to process distributed jobs and messages in nodejs
【***数组***】
pspnet完整代码实现
深度学习系列47:styleGAN总结
C language learning summary
正则表达式图文超详细总结不用死记硬背(上篇)
Xshell7 Download
Learning and using quartz scheduling framework
Why can't the index of JS array use negative numbers
滚动播报效果的实现
RFID数据安全性实验:C#可视化实现奇偶校验、CRC冗余校验、海明码校验