问题

[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

终于成功了.

摘抄

{Redis}NOAUTH Authentication required. Linux.cenOS的更多相关文章

  1. Redis NOAUTH Authentication required

    redis设置密码后停止服务报错,NOAUTH Authentication required 可以修改/etc/init.d/redis文件中的stop命令 $CLIEXEC -p $REDISPO ...

  2. Redis服务停止报错解决方案[NOAUTH Authentication required]

    Redis服务器设置密码后,使用service redis stop 会出现以下信息: service redis stop Stopping ... OK (error) NOAUTH Authen ...

  3. REdis MASTER aborted replication NOAUTH Authentication required

    对于REdis集群,如果设置了requirepass,则一定要设置masterauth,否则从节点无法正常工作,查看从节点日志可以看到哪下内容:19213:S 22 Apr 2019 10:52:17 ...

  4. redis安全 (error) NOAUTH Authentication required

    Redis 安全 我们可以通过 redis 的配置文件设置密码参数,这样客户端连接到 redis 服务就需要密码验证,这样可以让你的 redis 服务更安全. 实例 我们可以通过以下命令查看是否设置了 ...

  5. Redis报错 : (error) NOAUTH Authentication required.

    原文:Redis报错 : (error) NOAUTH Authentication required. 这个错误是因为没有用密码登陆认证 , 先输入密码试试 . 127.0.0.1:6379> ...

  6. Redis (error) NOAUTH Authentication required.

    首先查看redis设置密码没 127.0.0.1:6379> config get requirepass 1) "requirepass" 2) "" ...

  7. redis 执行操作时提示(error) NOAUTH Authentication required.

    (error) NOAUTH Authentication required. 出现认证问题,设置了认证密码,输入密码即可 127.0.0.1:6379> auth 123456

  8. redis出现错误:NOAUTH Authentication required.

    出现认证问题,应该是设置了认证密码,输入密码既可以啦 注意密码是字符串形式! 127.0.0.1:6379> auth "yourpassword" 127.0.0.1:63 ...

  9. Jedis异常解决:NOAUTH Authentication required

    引言 之前项目能够正常运行,因为默认选择db0,后来新的需求来了,不是默认db0,而是给参数选择db. 修改后代码如下,却报错NOAUTH Authentication required. 解决方法 ...

随机推荐

  1. geany写C语言,printf打印中文时显示乱码

    原因 geany设置了编码格式为utf8 运行时显示出的cmd窗口编码格式为GBK 解决方法 要么修改geany编码,要么修改cmd窗口编码. 修改geany编辑器为GBK编码格式 编辑=>首选 ...

  2. JVM垃圾回收器理论分析与详解【纯理论】

    继续上次[https://www.cnblogs.com/webor2006/p/10740084.html]的理论继续..有点吐血的感觉,都不知道学了这么一大堆理论有何实际意义,本身JVM就是个理论 ...

  3. com.mysql.jdbc.MysqlDataTruncation: Data truncation异常

    Exception in thread "main" com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too l ...

  4. JUnit 4.x 与 5.x 的区别?

    区别项 4.x 5.x 手动把测试和测试方法声明为public 需要 不需要 @Test 与JUnit 4的@Test注解不同的是,它没有声明任何属性,因为JUnit Jupiter中的测试扩展是基于 ...

  5. Easy-Mock模拟get接口和post接口实例

    1.先创建项目,再新建接口 创建项目入口:首页右下角 + 按钮 创建接口入口如下图: 关于mock的语法这里不做说明,可查看mock.js官方查看更详情的资料. 小tip:在Easy-Mock里面支持 ...

  6. [Algorithm] 387. First Unique Character in a String

    Given a string, find the first non-repeating character in it and return it's index. If it doesn't ex ...

  7. CSP-2019酱油记

    炸了 Day0 上午机房弥漫着颓废的气息... nc哥在疯狂打板子,我疯狂找水题找信心(然而被历次联赛T1爆切 退役气息稍重,好多人刷屏cnblogs.. 然后年级扛把子们来做指♂导啦- 准备了火龙果 ...

  8. oracle 如何快速删除两表非关联数据(脏数据)?

      1.情景展示 现在有两者表,表1中的主键id字段和表2的index_id相对应.如何删除两表非关联数据? 2.解决方案 --第1步 delete from VIRTUAL_CARD t where ...

  9. [Beta阶段]测试报告

    [Beta阶段]测试报告 博客目录 测试方法及过程 在正式发布前,为检验后端各接口功能的正确性,后端服务器对压力的耐受程度,以及前端各页面.功能的运行情况,我们对我们的服务器及小程序进行了多种测试.除 ...

  10. tinylib

    tinylib.h /* -------------------------------------------------------------------------------- oooo ` ...