问题

[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. 【 BowWow and the Timetable CodeForces - 1204A 】【思维】

    题目链接 可以发现 十进制4 对应 二进制100 十进制16 对应 二进制10000 十进制64 对应 二进制1000000 可以发现每多两个零,4的次幂就增加1. 用string读入题目给定的二进制 ...

  2. Pytorch并行计算:nn.parallel.replicate, scatter, gather, parallel_apply

    import torch import torch.nn as nn import ipdb class DataParallelModel(nn.Module): def __init__(self ...

  3. MATLAB问题小集合

    1.未定义与 'struct' 类型的输入参数相对应的函数 'tb_optparse' 在运行matlab程序时,出现上述错误. 原因是tb_optparse在common文件夹里面,没在robot文 ...

  4. flask实战-个人博客-程序骨架、创建数据库模型、临接列表关系 --

    编写程序骨架 personalBlog的功能主要分为三部分:博客前台.用户认证.博客后台,其中包含的功能点如下图所示: 数据库 personalBlog一共需要使用四张表,分别存储管理员(Admin) ...

  5. 服务器端渲染 VS 浏览器端渲染

    这里的渲染,就是指生成html文档的过程,和浏览器渲染html没有关系. 浏览器端渲染,指的是用js去生成html,前端做路由.举例:React, Vue等等前端框架.适合单页面应用程序. 服务器端渲 ...

  6. ssm批量删除

    ssm批量删除 批量删除:顾名思义就是一次性删除多个.删除是根据前台传给后台的id,那么所谓批量删除,就是将多个id传给后台,那么如何传过去呢,前后台的交互该如何实现? 1.jsp页面,先选中所有的要 ...

  7. log4j2 配置文件解读

    1.日志相关介绍 日志接口(slf4j):slf4j是对所有日志框架制定的一种规范.标准.接口,并不是一个框架的具体的实现,因为接口并不能独立使用,需要和具体的日志框架实现配合使用,比如log4j.l ...

  8. windows使用 xxx.bat运行相关指令

    今日思语:成人的世界,请停止低层次的忙碌 一般是windows上需要执行一些支持的命令时,我们一般都会直接使用控制台去操作,对于需要频繁操作的指令来说,使用控制台略显有些不便,比如不小心关闭后控制台后 ...

  9. Aizu2249-Road Construction-(Dijkstra)

    https://vjudge.net/problem/Aizu-2249 题意:计划图中有n个城市m条路,首都是1号城市,要选一些路去修,让各个城市到首都的路径最短,在路径最短的情况下修路费用最小. ...

  10. dolt 基于git协议的数据管理工具

    dolt 基于git 协议提供了多版本,分支特性的数据管理工具,使用简单,同时也提供了类似github 的一个云服务 安装 下载地址 https://github.com/liquidata-inc/ ...