当前位置:网站首页>redis 报错解决与常用配置
redis 报错解决与常用配置
2022-06-22 20:33:00 【猫鱼薄荷_她】
安装 redis
下载链接:如下载不成功可自行到官网下载 https://download.redis.io/releases
wget https://download.redis.io/releases/redis-6.2.1.tar.gz?_ga=2.213148948.1866727870.1617073678-1341157963.1617073678
--2021-03-30 11:19:41-- https://download.redis.io/releases/redis-6.2.1.tar.gz?_ga=2.213148948.1866727870.1617073678-1341157963.1617073678
查看是否启动成功
ps -aux | grep redis
netstat -nltp
测试是否能连接到 redis 服务器
redis 架构是 C/S 架构,在我们执行 redis-server 时服务端已经启动,如果想测试是否能连接到服务端可以用下面命令进行测试:
redis-cli // 这是 redis 给我们提供的客户端连接命令
配置 redis
修改端口:
{
自己实际安装路径}/redis/redis.conf
port 6379
修改密码:
{
自己实际安装路径}/redis/redis.conf
修改前:# requirepass foobared
修改后:requirepass admin123 // 修改成自己想设置的密码
设置多 IP 均可访问:
方法一:可直接注释 bind
方法二:bind 0.0.0.0
设置部分 IP 可访问:192.168.2.39 192.168.2.38
上述设置好之后还要再设置一步:
protected-mode no #将yes修改成no
报错一:The program ‘redis-server’ is currently not installed. To run ‘redis-server’ please ask your administrator to install the package ‘redis-server’
在安装好 redis 之后,输入命令 redis-server 时报错:The program 'redis-server' is currently not installed. To run 'redis-server' please ask your administrator to install the package 'redis-server'
解决办法:
在启动之前先执行如下命令:sudo make install
出错原因:redis-server 并未安装成功,官网建议在启动之前先执行上述命令sudo make install
报错二:Could not connect to Redis at 127.0.0.1:0: Connection refused
修改密码后是不支持用默认的 redis-cli 去连接服务器端,需要用一下命令:
redis-cli -p 自己设置的端口
如:redis-cli -p 11489
报错三:(error) NOAUTH Authentication required.
在设置好密码和端口之后,输入 redis-cli -p 11489 之后,会让我们输入自己的用户名进行认证,如果不进行认证就会报上述错误:
报错截图:
解决办法:
127.0.0.1:10419> auth "xxx" //具体的服务器登录名
OK
重启 redis
redis-server redis.conf
redis-conf :作为 redis 服务器端配置文件,相关信息可以在这里面配置,如:密码、端口等
redis-server:服务器端启动命令
边栏推荐
- 科研热点|官宣!2022年JCR分区和影响因子发布时间确定!
- shell(34) : 時間
- Lesson 028: Documents: because I know you, I will never forget the after-school test questions and answers [no title]
- 如何在物联网低代码平台中使用数据字典功能?
- Eureka服务注册与发现
- SPA项目开发之CRUD+表单验证
- Système de bibliothèque libre - service - cas de conception complète de l'interface tkinter et du formulaire openpyxl
- The interception of Chinese and English strings in Oracle database is different
- Database summary: common problems and Optimization in MySQL development
- Lesson 025: Dictionary: after class test questions and answers when the index is not easy to use
猜你喜欢

Database summary: common problems and Optimization in MySQL development

2022年朝阳区科技创新课之“产品创新与成果转化”训练营活动圆满结束

How to carry out encryption protection for equipment under extortion virus rampant

How to use the data dictionary function in the low code platform of the Internet of things?

Redis core technology and practice: learning summary directory

【知乎知识主推荐】 无人机中的城堡- 专注于无人机在不同技术领域的应用

6-3 non recursive traversal of binary tree

There are 15 necessary knowledge points for the second level cost engineer before the exam! I wish you success!

liunx 安装mysql

Implementation of breadth traversal adjacency matrix of 6-6 graph
随机推荐
Jericho uses DP and DM for IO key detection [chapter]
立体渲染
二级造价工程师考前必备15个知识点来了!祝你旗开得胜!
7-9 超级玛丽
Redis的使用场景分享(项目实战)
June25,2022 PMP Exam clearance manual-6
Lesson 029: Documents: a task? After class test questions and answers
Query es page subscript exceeds 10000
Leetcode daily question - 513 Find the value in the lower left corner of the tree
为什么感觉中国人月薪过万已经很普遍了?
Lesson 033: exception handling: you can't always be right 2 | after class test questions and answers
Lesson 028: Documents: because I know you, I will never forget the after-school test questions and answers [no title]
6-7 图的深度遍历-邻接表实现
【MAVROS】MAVROS 啓動指南
Why do you think it is common for Chinese people to earn more than 10000 yuan a month?
Implementation of depth traversal adjacency matrix of figure 6-5
不同网络结构的特征也能进行对比学习?蚂蚁&美团&南大&阿里提出跨架构自监督视频表示学习方法CACL,性能SOTA!
300. longest increasing subsequence ●●
Redis核心技术与实战:学习总结目录
7-9 super Mary