{Redis}NOAUTH Authentication required. Linux.cenOS
问题
[root@VM_0_12_centos redis]# ./bin/redis-cli -p 6379
127.0.0.1:6379> INFO
NOAUTH Authentication required.
解决方案.简述版本(推荐)
0.我所用到的命令集合
#先用最通用的命令,大部分的人的问题应该就是可以解决的.
[root@VM_0_12_centos redis]# ./bin/redis-cli -h 127.0.0.1 -p 6379
127.0.0.1:6379> AUTH 你的密码
#敬酒不吃吃罚酒的话,先找到进程ID(pid),然后kill即可
[root@VM_0_12_centos redis]# pgrep redis
31311
[root@VM_0_12_centos redis]# kill -9 31311
#启动服务,继续使用{AUTH}看看是否可以了.
[root@VM_0_12_centos redis]# ./bin/redis-server redis.conf
12557:C 06 Dec 2019 13:53:11.387 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
12557:C 06 Dec 2019 13:53:11.387 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=12557, just started
12557:C 06 Dec 2019 13:53:11.387 # Configuration loaded
[root@VM_0_12_centos redis]# ./bin/redis-cli -h 127.0.0.1 -p 6379
127.0.0.1:6379> INFO
NOAUTH Authentication required.
127.0.0.1:6379> AUTH 123456
OK
解决方案.详细过程(比较啰嗦)
1.解决方案.AUTH 你的密码
[root@VM_0_12_centos redis]# ./bin/redis-cli -h 127.0.0.1 -p 6379
127.0.0.1:6379> AUTH 123456
(error) ERR invalid password
127.0.0.1:6379> AUTH "123456"
(error) ERR invalid password
127.0.0.1:6379> AUTH '123456'
(error) ERR invalid password
这一步骤是网上最多的解决方案,
我后来也是用这个方式解决的.
只不过有些原因,导致我第一次使用这个方法的时候并没有效果.
2."(error) ERR invalid password"
线索到了"(error) ERR invalid password"这个提示语就断了.
我准备搜索下这个提示会不会给我带来惊喜.
3.思考原因
明明别人一条语句就可以"OK"的问题,
为啥我搞起来这么曲折.
网上搜索还说到过:可能是被黑了...
经过我仔细想了想我对{Redis}做过的,
有一个操作对这个影响确实很大:
我频繁了改过{redis.conf}中密码配置项{requirepass}.
我决定重启{Redis}服务...
再不行就重启{Linux}...
4.重启Redis服务
任何事情第一次搞起来总是曲折重重...
4.1. Redis的shutdown命令关闭服务,然后启动服务
[root@VM_0_12_centos redis]# redis-cli -p 6397 shutdown
Could not connect to Redis at 127.0.0.1:6397: Connection refused
很明显,失败了...也懒着再找这个失败的原因了.
搜索下其它重启服务的方式...
最后选择了简单粗暴型:kill
4.2 kill
我想先启动一下服务,然后在kill掉.
结果杀错了进程...
#启动你只是为了kill你...
[root@VM_0_12_centos redis]# ./bin/redis-server redis.conf
11448:C 06 Dec 2019 13:41:19.532 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
11448:C 06 Dec 2019 13:41:19.532 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=11448, just started
启动完之后我看了"pid=11448"...
我当时心里想:这就是那个倒霉蛋?
一个"just started"就要被"kill"的进程?
[root@VM_0_12_centos redis]# kill 11448
-bash: kill: (11448) - No such process
不好意思,认错进程了...
但是没关系,我又听说可以"kill -9"比较好使..值得一试...
[root@VM_0_12_centos redis]# kill -9
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
还是没关系,我再去搜索如何找到你,再去kill你...
[root@VM_0_12_centos redis]# ps -ef|grep redis
root 11793 10456 0 13:45 pts/0 00:00:00 grep --color=auto redis
root 31311 1 0 Nov26 ? 00:12:26 ./bin/redis-server *:6379
[root@VM_0_12_centos redis]# kill 31311
#再次执行ps -ef|grep 看看有没有成功...
[root@VM_0_12_centos redis]# ps -ef|grep redis
root 11793 10456 0 13:46 pts/0 00:00:00 grep --color=auto redis
root 31311 1 0 Nov26 ? 00:12:26 ./bin/redis-server *:6379
很明显,又失败了...
首先我对于"31311"是否是redis的pid,保持怀疑态度.
并且如果是的话,那"11793 10456"pid又是什么鬼?
我决定换个命令,能明确告诉我{redis.pid}是什么...
[root@VM_0_12_centos redis]# pgrep redis
31311
这下可以了,找到正主了"31311"...
[root@VM_0_12_centos redis]# kill 31311
[root@VM_0_12_centos redis]# redis-cli
127.0.0.1:6379> INFO
NOAUTH Authentication required.
127.0.0.1:6379> AUTH 123456
(error) ERR invalid password
又失败了...是时候探索下"kill -9"的用法了...
[root@VM_0_12_centos redis]# kill -9 31311
[root@VM_0_12_centos redis]# ps -ef|grep redis
root 12196 10456 0 13:51 pts/0 00:00:00 grep --color=auto redis
[root@VM_0_12_centos redis]# ./bin/redis-server redis.conf
12557:C 06 Dec 2019 13:53:11.387 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
12557:C 06 Dec 2019 13:53:11.387 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=12557, just started
12557:C 06 Dec 2019 13:53:11.387 # Configuration loaded
[root@VM_0_12_centos redis]# ./bin/redis-cli -h 127.0.0.1 -p 6379
127.0.0.1:6379> INFO
NOAUTH Authentication required.
127.0.0.1:6379> AUTH 123456
OK
终于成功了.
摘抄
- https://www.cnblogs.com/xiaozong/p/5652563.html
- https://blog.csdn.net/kevinsingapore/article/details/82344603
{Redis}NOAUTH Authentication required. Linux.cenOS的更多相关文章
- Redis NOAUTH Authentication required
redis设置密码后停止服务报错,NOAUTH Authentication required 可以修改/etc/init.d/redis文件中的stop命令 $CLIEXEC -p $REDISPO ...
- Redis服务停止报错解决方案[NOAUTH Authentication required]
Redis服务器设置密码后,使用service redis stop 会出现以下信息: service redis stop Stopping ... OK (error) NOAUTH Authen ...
- REdis MASTER aborted replication NOAUTH Authentication required
对于REdis集群,如果设置了requirepass,则一定要设置masterauth,否则从节点无法正常工作,查看从节点日志可以看到哪下内容:19213:S 22 Apr 2019 10:52:17 ...
- redis安全 (error) NOAUTH Authentication required
Redis 安全 我们可以通过 redis 的配置文件设置密码参数,这样客户端连接到 redis 服务就需要密码验证,这样可以让你的 redis 服务更安全. 实例 我们可以通过以下命令查看是否设置了 ...
- Redis报错 : (error) NOAUTH Authentication required.
原文:Redis报错 : (error) NOAUTH Authentication required. 这个错误是因为没有用密码登陆认证 , 先输入密码试试 . 127.0.0.1:6379> ...
- Redis (error) NOAUTH Authentication required.
首先查看redis设置密码没 127.0.0.1:6379> config get requirepass 1) "requirepass" 2) "" ...
- redis 执行操作时提示(error) NOAUTH Authentication required.
(error) NOAUTH Authentication required. 出现认证问题,设置了认证密码,输入密码即可 127.0.0.1:6379> auth 123456
- redis出现错误:NOAUTH Authentication required.
出现认证问题,应该是设置了认证密码,输入密码既可以啦 注意密码是字符串形式! 127.0.0.1:6379> auth "yourpassword" 127.0.0.1:63 ...
- Jedis异常解决:NOAUTH Authentication required
引言 之前项目能够正常运行,因为默认选择db0,后来新的需求来了,不是默认db0,而是给参数选择db. 修改后代码如下,却报错NOAUTH Authentication required. 解决方法 ...
随机推荐
- JMeter基础【第六篇】JMeter5.1事务、检查点、集合点、思考时间、其余设置等
JMeter5.1事务.检查点.集合点.思考时间.其余设置等
- 品优购项目 单表过程 乒乓过程 入口 MyBatis逆向工程 dubbo框架搭建 品牌表CRUD bug集锦
- Generative Adversarial Networks overview(2)
Libo1575899134@outlook.com Libo (原创文章,转发请注明作者) 本文章会先从Gan的简单应用示例讲起,从三个方面问题以及解决思路覆盖25篇GAN论文,第二个大部分会进一步 ...
- python语言(四)关键字参数、内置函数、导入第三方模块、OS模块、时间模块
一.可变参数 定义函数时,有时候我们不确定调用的时候会传递多少个参数(不传参也可以).此时,可用包裹(packing)位置参数(*args),或者包裹关键字参数(**kwargs),来进行参数传递,会 ...
- Docker中Maven私服的搭建
为何用到Maven私服? 在实际开发中,项目中可能会用到第三方的jar.内部通讯的服务接口都会打入到公司的私服中. 我们从项目实际开发来看: 一些无法从外部仓库下载的构件,例如内部的项目还能部署到私服 ...
- C# 按行读取文件 从某行开始取
; FileStream fs = new FileStream(e.FullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); u ...
- Jupyter的快捷键使用
命令模式 (按键 Esc 开启) Enter : 转入编辑模式 Shift-Enter : 运行本单元,选中下个单元 Ctrl-Enter : 运行本单元 Alt-Enter : 运行本单元,在其下插 ...
- AsyncAPI 几个方便的工具
AsyncAPI 类似openapi 也提供了一些周边工具 editor 类似openapi 的,但是目前官方已经不推荐使用了,推荐使用playground,以下是构建一个容器镜像 clone 代码 ...
- 17-网页,网站,微信公众号基础入门(使用Adobe Dreamweaver CS6 制作网页/网站)
https://www.cnblogs.com/yangfengwu/p/11351182.html https://www.cnblogs.com/yangfengwu/p/11200767.htm ...
- 给codeblocks的c编译选项添加c99标准
在codeblocks的settings中选择 compiler and debugger,选择compile setting 在其中有other options,在里面写上-std=c99 这样就可 ...