问题

[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. MinGW-w64离线安装

    1.下载 如果你能从在线 安装,那最好就在线安装吧. 如果你能连上官网,那可以选择从官网去下载,地址:https://osdn.net/projects/mingw/releases/ https:/ ...

  2. cmds系统归并缓慢的处理过程 2017-2-16

      检查反应较慢的时间段,数据库整体运行情况,从awr报告总看看是否有异常   以上是两个节点的等待事件排行,其中发现cursor: pin S wait on X等待事件类型是并行,切较高,开始分析 ...

  3. CSS进阶之路

    下面主要引用http://www.cnblogs.com/wangfupeng1988/tag/css知多少/ CSS进阶笔记: 一.学习CSS的三个突破点 1.浏览器如何加载和解析CSS——CSS的 ...

  4. c语言的#和##的用法

    #include <stdio.h> #define ADD(A,B) printf(#A " + " #B " = %d\n",((A)+(B)) ...

  5. React Virtual DOM Explained in Simple English

    If you are using React or learning React, you must have heard of the term “Virtual DOM”. Now what is ...

  6. codeforces1267G

    考虑我们在某个时刻,剩下的数有 $ i $ 个,这些数的和为 $ j $,那么我们期望要抽 $ n \over i $ 次才能取到一个新的物品,这个物品的期望权值为 $ j \over i $,我们花 ...

  7. Eclipse中将java类打成jar包形式运行

    记录一次帮助小伙伴将java类打成jar包运行 1.创建java project项目 file > new > project > java project 随便起一个项目名称,fi ...

  8. Python运行语法错误:IndentationError: unindent does not match any outer indentation level

    python脚本没有对齐.新的Python语法,是不支持的代码对齐中,混用TAB和空格的.

  9. Java中的long类型和Long类型比较大小

    Java中我们经常要做一些判断,而对于判断的话,用的最多的便是“>”.“==”.“<”的比较,这里我们进行一个Long类型数据和long类型数据的比较大小的讲解. Java中Long和lo ...

  10. Debian系Linux 发行版 源配置说明

    概述: 本文是在逛论坛是的发现,借鉴过来,以便学习.源列表主文件 /etc/apt/sources.list同时也可创建独立的源配置文件到 /etc/apt/sources.list.d/* 下 so ...