redis 任何命令都执行不了,抛错 NOAUTH Authentication required

redis服务停止(NOAUTH Authentication required)问题处理 redis服务停止(NOAUTH Authentication required)处理方法 阅读详情

redis每次启动和关闭,要执行相关命令,有时候手写容易出错,或是长期没有碰她,一时间可能忘记了命令。所以,今天我就在 /redis/bin 安装装目录下新建了一个启动脚本run..sh,编写如下内容,来便捷地启动和关闭redis服务。

前言

脚本文件run.sh 内容如下:

#!/bin/bash
if [[  -n "$1" ]] ; then
        action=$1
fi
if [ "$action" == "start" ] ;then
        echo "welcome,coder!"
        ./redis-server ./redis.conf
        echo "redis is running"
        exit 1
fi
if [ "$action" == "stop" ] ;then
    ./redis-cli  shutdown 
    echo "goodbye!"
    exit 1
fi

./run.sh start 命令启动redis服务没有问题,可是当我执行./run.sh stop 指令来关闭redsi服务的时候,就会抛出:NOAUTH Authentication required 错误。

[root@localhost bin]# ./run.sh  stop  //命令控制redis关闭服务
(error) NOAUTH Authentication required.
[root@localhost bin]# 

正文

当redis设置了密码,但是没有登录,然后执行如redis-cli shutdown等命令时,就可能抛出NOAUTH Authentication required错误。甚至可能连GET、SET这种常见的命令执行也会抛错。如下图:

[root@localhost bin]# ./redis-cli        //进入redis客户端
127.0.0.1:6379> GET NUM			//获取key为NUM的值
(error) NOAUTH Authentication required.
127.0.0.1:6379> 

解决办法很简单,即去授权:

127.0.0.1:6379> auth "123456"   //123456为配置文件  requirepass 字段值
OK
127.0.0.1:6379> GET NUM
"0"
127.0.0.1:6379> 

现在我们 退出redis客户端。执行如下命令关闭redis服务:

127.0.0.1:6379> exit   //退出redis客户端
[root@localhost bin]# ./redis-cli shutdown  //命令控制redis关闭服务
(error) NOAUTH Authentication required.
[root@localhost bin]# 

依然会抛错。那怎么办呢?可以执行如下命令来代替:

./redis-cli -a  "123456" -p 6379 shutdown    //“123456” 为 requirepass 字段值 ,6379 为端口

解决方案

所以,我的问题题就解决了,重新定义编写run.sh 脚本如下:

#!/bin/bash
if [[  -n "$1" ]] ; then
        action=$1
fi
if [ "$action" == "start" ] ;then
        echo "welcome,coder!"
        ./redis-server ./redis.conf
        echo "redis is running"
        exit 1
fi
if [ "$action" == "stop" ] ;then
    ./redis-cli -a  "123456" -p 6379 shutdown   # 代替./redis-cli shutdown
    echo "goodbye!"
    exit 1
fi
Redis报错NOAUTH Authentication required的密码认证 Redis报错NOAUTH Authentication required通常是由于Redis服务器要求密码认证,但客户端未提供或配置错误导致的。常见原因包括Redis未配置密码、密码配置错误、客户端未指定密码或Redis服务未运行。解决方案包括在Redis配置文件中设置密码、在客户端连接时指定密码、检查密码配置是否一致以及确保Redis服务正常运行。预防措施包括统一权限管理、使用版本控制、彻底测试连接功能、使用IDE工具辅助以及增加代码的健壮性。通过理解错误成因并采取相应措施,可以有效避免和解决此类问题, 阅读详情

相关推荐

Redis报错NOAUTH Authentication required怎么解决?

在使用redis-cli时,可能会遇到报错。

十三月的博客 4674

Redis 出现(error)NOAUTH Authentication required. 报错的解决办法,秒懂!

意思:需要NOAUTH身份验证,那你输入密码验证就可以。

qq_63438013的博客 2万+

redis config get requirepass (error) NOAUTH Authentication required.

我是一名redis小白,今天第一次安装redis,遇到了这个问题,解决的很是头疼 首先,检测后台redis进程存在 然后,我就进入端口想练习命令: 我也不知道为什么错,反正是报了这个错,然后我上网搜答案,说是要验证密码: auth “这里输入我的密码”,但是报错了,我输入的是linux的密码 后来去修改redis.conf文件,在文件中找到requirepass,把前面的#去掉,修改成自己的密...

没有伞的孩子只能快跑,如若不跑,只有一个结果:超过你的人回头鄙视你 6064

redis中执行shutdown命令时报(error) NOAUTH Authentication required

C:\Redis-x64-3.0.504>redis-cli.exe -h 192.168.0.8 -p 6379 192.168.0.8:6379> shutdown (error) NOAUTH Authentication required. 192.168.0.8:6379> shutdown (error) NOAUTH Authentication requi...

一火的专栏 2577

STM32 Proteu直流电机正反转控制系统限位开关-0035

硬件组成:STM32F103C6单片机 +L298N电机控制电路+直流电机+3个按键(正转、反转、停止)+LED指示灯(正转、反转、停止)+限位开关(正限位 反限位) 1.通过3个按键(正转、反转、停止)控制电机的正转、反转、停止。 2.有3个LED指示灯,正转时正转指示灯亮。反转停止对应反转停止指示灯亮。 3.有自动正转反转停止功能,正转时当正限位按键按下时说明正转到最大距离。此时自动停止。反转一样。

zhaxiaobian_er的博客 2002

告别黑窗口:XShell+X11转发图形化界面的5分钟保姆级教程(附Xming配置)

本文详细介绍了如何使用XShell和X11转发技术快速实现Linux图形化界面的远程访问。通过5分钟快速配置指南,包括服务端设置、客户端工具选择及XShell+Xming的完美配置,帮助用户高效运行GUI应用程序,提升远程工作效率。特别适合需要图形化操作的开发者和运维人员。

weixin_29223603的博客 326

redis-cli shutdown 出现 (error) NOAUTH Authentication required.

redis 设置密码登录后,想关闭redis服务器,需要 redis-cli -a 密码 shutdown

haha_rookie的博客 1万+

Ubuntu24.04/20.04设置网络共享文件夹

Ubuntu20.04利用向日葵远程控制时,不能传输文件。使用linux版本QQ来传输是可以的,不过linuxqq功能真的很弱。因此,打算在Ubuntu系统中建立一个共享文件夹,可在局域网中访问。 1、新建共享文件夹 获取root权限,或者登陆root账户。可在/home文件夹(或其它文件夹)下新建一个文件夹,如share。 右击文件夹,选择“本地网络共享”菜单。按下图设置。 点击确定。如果系统已经安装了samba服务器,就可以进入第3步。如果没有,会提示安装,按提示安装,可能会出错,可进.

willhu2008的专栏 2万+

【BUG】已解决:NOAUTH Authentication required

NOAUTH Authentication required

m0_73367097的博客 4467

ESP32-S3双模CMSIS-DAP调试器:USB+WiFi无线调试方案

CMSIS-DAP是ARM生态中标准化的嵌入式调试协议接口,广泛用于Keil、IAR、STM32CubeIDE等开发环境。其核心原理是通过SWD/JTAG物理层实现目标芯片寄存器访问、内存读写与断点控制,依赖确定性时序和低延迟通信。传统DAPLink调试器受限于USB线缆束缚,而WiFi-USB-DAPLink项目将完整CMSIS-DAP v2协议栈移植至ESP32-S3平台,同时支持USB CDC直连与WiFi TCP远程通道,兼顾实时性与网络化部署能力。该方案无需主机驱动、兼容主流IDE,并支持多机并发

weixin_31185473的博客 366

【仿真】Carla Python API实战:从零搭建自动驾驶测试环境

本文详细介绍了如何使用Carla Python API从零搭建自动驾驶测试环境。通过Carla仿真平台,开发者可以构建高度逼真的城市环境和车辆物理模型,利用Python API实现传感器配置、数据采集、场景构建及自动驾驶算法集成。文章还分享了实际项目中的调试技巧和性能优化经验,帮助读者快速掌握自动驾驶仿真测试的核心技术。

weixin_29050513的博客 213

Redis (error) NOAUTH Authentication required.解决方法

Redis (error) NOAUTH Authentication required.解决方法 出现认证问题,应该是设置了认证密码,输入密码既可以啦 注意密码是字符串形式! 127.0.0.1:6379>auth"yourpassword" 例如密码是‘root’,当出现认证问题时候,输入“auth ‘root’”即可 127.0.0.1:6379>s...

baidu_41634343的博客 12万+

AMD Ryzen AI Max+ 395四机集群实战:开源工具链与大模型推理优化全解析

本文详细解析了基于AMD Ryzen AI Max+ 395处理器的四机集群搭建与优化实践,涵盖硬件配置、开源工具链评测及大模型推理优化技巧。通过深度测试,揭示了集群在AI推理中的性能瓶颈与解决方案,特别适合需要扩展显存的大模型实验场景。文章还提供了成本效益分析,帮助开发者做出更明智的选型决策。

weixin_29041767的博客 1517

redis部署报错 NOAUTH Authentication required.

redis部署报错 Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required. NOAUTH Authentication required. 意思是不需要身份验证 首先先检查部署时进行的配置详情可查看:阿里云centos7安装redis 1.下载安装的redis默认是没有密码的。设置密码之后需要密码认证。 密码设置: 在

NMZLduiduidui的博客 1万+

远程声控系统(MATLAB代码见优快云资源)

远程声控系统技术报告 一、题目要求 实现一个远程声音控制系统。首先采集不同的语音指示信号,进行适当压缩;然后通过噪声信道实现远程传输,远端接收后再通过适当计算识别出是何指示,最后送入一个处于未知状态、但能控/能观的控制系统,完成不同的控制动作。 二、问题分解与解决思路 2.1 系统设计 实验中以汉语数字语音1~9作为指令,数字语音“1”代表一号指令,数字语音“2”代表二号指令,依次类推。发送端发出语音“1”,发送端对应的数字语音文件为“1b.wav”,通过信源编码对语音进行压缩编码,然后进行信道编码并进行基

业精于勤,荒于嬉 5734

基于QT+Halcon实现线序识别

一、线序识别算法步骤。 1.按照检测区域m_pItem1的外接矩形(rtBount)的大小, 截取感兴趣区域图像hRoi。 2.把截取出来的感兴趣区域图像hRoi, 分离出R、G、B三个通道hRed、hGreen、hBlue。 3.把hRed、hGreen、hBlue三个通道转换成cielab颜色空间, 得到hChannelL、hChannelA、hChannelB三个颜色图。 4.设m_pItem1的宽为iItemW, 高为iItemH. 分别申请大小为iItemW的pSumL、pSumA、pSumB内

专注现代C++实战,从核心语法到高性能编程,助力开发者深入掌握系统级编程精髓。 1748

【工作笔记】Springboot集成Redis添加密码连接"NOAUTH Authentication required"

一个很简单的问题,使用Springboot集成Redis,并且添加Auth授权,正常配置我认为是这样的: spring: redis: database: 0 url: redis://127.0.0.1:6379 password: 123456password ssl: false timeout: 1000 jedis: p...

马路上开飞机 6016

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

NOAUTH Authentication required 解决办法

redis 操作提升:NOAUTH Authentication required. 其字面意思是要进行权限认证 **解决办法: 输入redis 密码 ** 格式为 : auth 密码 如下: 其中123456 是我的redis密码 (error) NOAUTH Authentication required. 127.0.0.1:6379> auth 123456 OK 127.0.0.1:6379> ...

weixin_44012027的博客 12万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

JedisDataException:NOAUTH Authentication required.

JedisDataException: NOAUTH Authentication required. Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required. at redis.clients.jedis.Protocol.processError(Protocol.java:132) at redis.clients.jedis.Proto

脚踏实地,步步高升 6262

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

NOAUTH Authentication required redis

今天突然之间遇到redis:NOAUTH Authentication required的问题,登录服务器也无法对redis进行存储查询操作。上网查了下说是被黑客攻击,具体各位可以在网上查到。这里说下我的处理方案。 我的redis是用docker安装的,跟一般的直接安装稍微有些区别,在上网搜的时候说是要修改redis.conf中的requirepass参数,在redis-cli 中执行req

坤哥的博客 6703

LINUX下 redis 报错 (error) NOAUTH Authentication required

LINUX下 redis 报错 (error) NOAUTH Authentication required [root@123 src]# ./redis-cli -h 127.0.0.1 -p 6379 Could not connect to Redis at 127.0.0.1:6379: Connection refused Could not connect to Redis at 1...

janet1100的博客 3418

linux关闭redis时报NOAUTH Authentication required

linux关闭redis时报NOAUTH Authentication required 为什么会出现这种问题?(问题缘由) 不能光解决问题,还得知道这个问题是怎样出现的(纯属个人观点,大佬勿喷),接下来就说说我这边是怎么出现这个问题的,linux安装redis网上有很多文档(我自己用的是这一篇https://www.cnblogs.com/zuidongfeng/p/8032505.html,设...

浪浪的博客 2729

Redis连接报错“NOAUTH Authentication required”解决方案

当你在尝试连接Redis服务器并执行操作时,如果遇到了“(error) NOAUTH Authentication required”的错误,这通常意味着你的Redis服务器配置了密码认证,但你在连接时没有提供正确的密码。下面,我们将提供两种解决方案来修复这个问题。

Elusia-ForEver 2万+

redis报错NOAUTH Authentication required.

redis报错NOAUTH Authentication required.

sunxiaohong__的博客 8622

springboot连接Redis报NOAUTH Authentication required

项目接入redis,连接报错,百度后是没有输入密码,但是在测试环境是正常的。修改多次密码失效,直接使用redis-cli连接,也是只有没输入密码时才会报这个错,密码错误是另一个提示。那应该和redis版本和redis客户端有关。

qq_28722667的博客 2319

redis (error) NOAUTH Authentication required 问题分析解决

记录 redis 日常开发学习

Azure_xw的博客 7930
上一篇: 单个Redis实例下的锁正确使用姿势
下一篇: redis的INFO命令使用详解
She_lock
博客等级 码龄12年 157粉丝 134原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值