宝塔redis报错auth认证失败解决笔记!

宝塔redis报错auth认证失败解决笔记!

宝塔redis重置密码
宝塔设置redis新密码requirepass,命令行重置密码和置空密码都无用:
最后发现/www/server/redis/redis.conf配置文件有两个requirepass
宝塔面板修改redis密码是上面一个,被下面一个旧的覆盖了。

修改配置文件后,要重启redis服务。否则刚修改的密码没生效!

宝塔redis客户端工具、网站、命令行登录认证的各种报错如下:

WRONGPASS invalid username-password pair or user is disabled.

(error) NOAUTH Authentication required.
(error) WRONGPASS invalid username-password pair or user is disabled.

`AUTH` failed: ERR AUTH <password> called without any password configured for the default user. 
Are you sure your configuration is correct? [tcp://127.0.0.1:6379]

(error) ERR AUTH <password> called without any password configured for the default user. 
Are you sure your configuration is correct?

命令行重设密码: config set requirepass "admin"

命令行登录redis:

[root@xxx redis]# service redis restart  #重启redis服务
[root@xxx redis]# redis-cli   
127.0.0.1:6379> auth password
OK
127.0.0.1:6379>  exit


[root@xxx redis]# redis-cli -h 127.0.0.1 -p 6379 -a password 
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> keys *
1) "redisutil"
2) "ranks"
127.0.0.1:6379> 

windows宝塔安装的redis代码中连接报错:
redis :ERR AUTH <password> called without any password configured for the default user
试着宝塔上停用redis,但命令行还是可以连接。怀疑是不是开了两个实例。
解决Ctrl+shift+Esc结束redis-serverredis-cli所有进程。重启redis,代码连接也ok了

#密码对却提示:在没有为默认用户配置任何密码的情况下调用ERR AUTH<password>。你确定你的配置正确吗?
127.0.0.1:6379> auth root
(error) ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
127.0.0.1:6379>
redis>redis-cli -h 127.0.0.1 -p 6379 -a root
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
Warning: AUTH failed
127.0.0.1:6379> keys *
1) "name"
127.0.0.1:6379> get name
"lucy"

#

redis>redis-cli -h 127.0.0.1 -p 6379 -a root
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> keys *
(empty array)

作者:DragonersLi
链接:https://www.jianshu.com/p/035691128ce4
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/241165.html

(0)
上一篇 2022年4月6日 00:02
下一篇 2022年4月6日

相关推荐

发表回复

登录后才能评论